Merge branch 'xfs-misc-fixes-4.6' into for-next
This commit is contained in:
Коммит
6d247d47fb
|
@ -118,8 +118,6 @@ xfs_allocbt_free_block(
|
||||||
xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
|
xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
|
||||||
XFS_EXTENT_BUSY_SKIP_DISCARD);
|
XFS_EXTENT_BUSY_SKIP_DISCARD);
|
||||||
xfs_trans_agbtree_delta(cur->bc_tp, -1);
|
xfs_trans_agbtree_delta(cur->bc_tp, -1);
|
||||||
|
|
||||||
xfs_trans_binval(cur->bc_tp, bp);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,22 +24,6 @@
|
||||||
* Small attribute lists are packed as tightly as possible so as
|
* Small attribute lists are packed as tightly as possible so as
|
||||||
* to fit into the literal area of the inode.
|
* to fit into the literal area of the inode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Entries are packed toward the top as tight as possible.
|
|
||||||
*/
|
|
||||||
typedef struct xfs_attr_shortform {
|
|
||||||
struct xfs_attr_sf_hdr { /* constant-structure header block */
|
|
||||||
__be16 totsize; /* total bytes in shortform list */
|
|
||||||
__u8 count; /* count of active entries */
|
|
||||||
} hdr;
|
|
||||||
struct xfs_attr_sf_entry {
|
|
||||||
__uint8_t namelen; /* actual length of name (no NULL) */
|
|
||||||
__uint8_t valuelen; /* actual length of value (no NULL) */
|
|
||||||
__uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
|
|
||||||
__uint8_t nameval[1]; /* name & value bytes concatenated */
|
|
||||||
} list[1]; /* variable sized array */
|
|
||||||
} xfs_attr_shortform_t;
|
|
||||||
typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
|
typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
|
||||||
typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
|
typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
|
||||||
|
|
||||||
|
|
|
@ -531,7 +531,6 @@ xfs_bmbt_free_block(
|
||||||
|
|
||||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
||||||
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
|
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
|
||||||
xfs_trans_binval(tp, bp);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -294,6 +294,21 @@ xfs_btree_sblock_verify_crc(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
xfs_btree_free_block(
|
||||||
|
struct xfs_btree_cur *cur,
|
||||||
|
struct xfs_buf *bp)
|
||||||
|
{
|
||||||
|
int error;
|
||||||
|
|
||||||
|
error = cur->bc_ops->free_block(cur, bp);
|
||||||
|
if (!error) {
|
||||||
|
xfs_trans_binval(cur->bc_tp, bp);
|
||||||
|
XFS_BTREE_STATS_INC(cur, free);
|
||||||
|
}
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delete the btree cursor.
|
* Delete the btree cursor.
|
||||||
*/
|
*/
|
||||||
|
@ -3209,6 +3224,7 @@ xfs_btree_kill_iroot(
|
||||||
int level;
|
int level;
|
||||||
int index;
|
int index;
|
||||||
int numrecs;
|
int numrecs;
|
||||||
|
int error;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
union xfs_btree_ptr ptr;
|
union xfs_btree_ptr ptr;
|
||||||
int i;
|
int i;
|
||||||
|
@ -3272,8 +3288,6 @@ xfs_btree_kill_iroot(
|
||||||
cpp = xfs_btree_ptr_addr(cur, 1, cblock);
|
cpp = xfs_btree_ptr_addr(cur, 1, cblock);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
for (i = 0; i < numrecs; i++) {
|
for (i = 0; i < numrecs; i++) {
|
||||||
int error;
|
|
||||||
|
|
||||||
error = xfs_btree_check_ptr(cur, cpp, i, level - 1);
|
error = xfs_btree_check_ptr(cur, cpp, i, level - 1);
|
||||||
if (error) {
|
if (error) {
|
||||||
XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
|
XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
|
||||||
|
@ -3283,8 +3297,11 @@ xfs_btree_kill_iroot(
|
||||||
#endif
|
#endif
|
||||||
xfs_btree_copy_ptrs(cur, pp, cpp, numrecs);
|
xfs_btree_copy_ptrs(cur, pp, cpp, numrecs);
|
||||||
|
|
||||||
cur->bc_ops->free_block(cur, cbp);
|
error = xfs_btree_free_block(cur, cbp);
|
||||||
XFS_BTREE_STATS_INC(cur, free);
|
if (error) {
|
||||||
|
XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
cur->bc_bufs[level - 1] = NULL;
|
cur->bc_bufs[level - 1] = NULL;
|
||||||
be16_add_cpu(&block->bb_level, -1);
|
be16_add_cpu(&block->bb_level, -1);
|
||||||
|
@ -3317,14 +3334,12 @@ xfs_btree_kill_root(
|
||||||
*/
|
*/
|
||||||
cur->bc_ops->set_root(cur, newroot, -1);
|
cur->bc_ops->set_root(cur, newroot, -1);
|
||||||
|
|
||||||
error = cur->bc_ops->free_block(cur, bp);
|
error = xfs_btree_free_block(cur, bp);
|
||||||
if (error) {
|
if (error) {
|
||||||
XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
|
XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
XFS_BTREE_STATS_INC(cur, free);
|
|
||||||
|
|
||||||
cur->bc_bufs[level] = NULL;
|
cur->bc_bufs[level] = NULL;
|
||||||
cur->bc_ra[level] = 0;
|
cur->bc_ra[level] = 0;
|
||||||
cur->bc_nlevels--;
|
cur->bc_nlevels--;
|
||||||
|
@ -3830,10 +3845,9 @@ xfs_btree_delrec(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the deleted block. */
|
/* Free the deleted block. */
|
||||||
error = cur->bc_ops->free_block(cur, rbp);
|
error = xfs_btree_free_block(cur, rbp);
|
||||||
if (error)
|
if (error)
|
||||||
goto error0;
|
goto error0;
|
||||||
XFS_BTREE_STATS_INC(cur, free);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we joined with the left neighbor, set the buffer in the
|
* If we joined with the left neighbor, set the buffer in the
|
||||||
|
|
|
@ -641,6 +641,22 @@ xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp)
|
||||||
*/
|
*/
|
||||||
#define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */
|
#define XFS_ATTR_LEAF_MAPSIZE 3 /* how many freespace slots */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Entries are packed toward the top as tight as possible.
|
||||||
|
*/
|
||||||
|
typedef struct xfs_attr_shortform {
|
||||||
|
struct xfs_attr_sf_hdr { /* constant-structure header block */
|
||||||
|
__be16 totsize; /* total bytes in shortform list */
|
||||||
|
__u8 count; /* count of active entries */
|
||||||
|
} hdr;
|
||||||
|
struct xfs_attr_sf_entry {
|
||||||
|
__uint8_t namelen; /* actual length of name (no NULL) */
|
||||||
|
__uint8_t valuelen; /* actual length of value (no NULL) */
|
||||||
|
__uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
|
||||||
|
__uint8_t nameval[1]; /* name & value bytes concatenated */
|
||||||
|
} list[1]; /* variable sized array */
|
||||||
|
} xfs_attr_shortform_t;
|
||||||
|
|
||||||
typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */
|
typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */
|
||||||
__be16 base; /* base of free region */
|
__be16 base; /* base of free region */
|
||||||
__be16 size; /* length of free region */
|
__be16 size; /* length of free region */
|
||||||
|
|
|
@ -125,16 +125,8 @@ xfs_inobt_free_block(
|
||||||
struct xfs_btree_cur *cur,
|
struct xfs_btree_cur *cur,
|
||||||
struct xfs_buf *bp)
|
struct xfs_buf *bp)
|
||||||
{
|
{
|
||||||
xfs_fsblock_t fsbno;
|
return xfs_free_extent(cur->bc_tp,
|
||||||
int error;
|
XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)), 1);
|
||||||
|
|
||||||
fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp));
|
|
||||||
error = xfs_free_extent(cur->bc_tp, fsbno, 1);
|
|
||||||
if (error)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
xfs_trans_binval(cur->bc_tp, bp);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "xfs_error.h"
|
#include "xfs_error.h"
|
||||||
#include "xfs_trace.h"
|
#include "xfs_trace.h"
|
||||||
#include "xfs_attr_sf.h"
|
#include "xfs_attr_sf.h"
|
||||||
|
#include "xfs_da_format.h"
|
||||||
|
|
||||||
kmem_zone_t *xfs_ifork_zone;
|
kmem_zone_t *xfs_ifork_zone;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ extern struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *, xfs_agnumber_t,
|
||||||
extern void xfs_perag_put(struct xfs_perag *pag);
|
extern void xfs_perag_put(struct xfs_perag *pag);
|
||||||
extern int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
|
extern int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
|
||||||
|
|
||||||
extern void xfs_sb_calc_crc(struct xfs_buf *bp);
|
|
||||||
extern void xfs_log_sb(struct xfs_trans *tp);
|
extern void xfs_log_sb(struct xfs_trans *tp);
|
||||||
extern int xfs_sync_sb(struct xfs_mount *mp, bool wait);
|
extern int xfs_sync_sb(struct xfs_mount *mp, bool wait);
|
||||||
extern void xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp);
|
extern void xfs_sb_mount_common(struct xfs_mount *mp, struct xfs_sb *sbp);
|
||||||
|
|
|
@ -218,10 +218,12 @@ xfs_end_io(
|
||||||
struct xfs_inode *ip = XFS_I(ioend->io_inode);
|
struct xfs_inode *ip = XFS_I(ioend->io_inode);
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
|
/*
|
||||||
|
* Set an error if the mount has shut down and proceed with end I/O
|
||||||
|
* processing so it can perform whatever cleanups are necessary.
|
||||||
|
*/
|
||||||
|
if (XFS_FORCED_SHUTDOWN(ip->i_mount))
|
||||||
ioend->io_error = -EIO;
|
ioend->io_error = -EIO;
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For unwritten extents we need to issue transactions to convert a
|
* For unwritten extents we need to issue transactions to convert a
|
||||||
|
@ -1702,12 +1704,20 @@ xfs_vm_write_failed(
|
||||||
if (block_start >= to)
|
if (block_start >= to)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!buffer_delay(bh))
|
/*
|
||||||
|
* Process delalloc and unwritten buffers beyond EOF. We can
|
||||||
|
* encounter unwritten buffers in the event that a file has
|
||||||
|
* post-EOF unwritten extents and an extending write happens to
|
||||||
|
* fail (e.g., an unaligned write that also involves a delalloc
|
||||||
|
* to the same page).
|
||||||
|
*/
|
||||||
|
if (!buffer_delay(bh) && !buffer_unwritten(bh))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!buffer_new(bh) && block_offset < i_size_read(inode))
|
if (!buffer_new(bh) && block_offset < i_size_read(inode))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (buffer_delay(bh))
|
||||||
xfs_vm_kill_delalloc_range(inode, block_offset,
|
xfs_vm_kill_delalloc_range(inode, block_offset,
|
||||||
block_offset + bh->b_size);
|
block_offset + bh->b_size);
|
||||||
|
|
||||||
|
@ -1720,6 +1730,7 @@ xfs_vm_write_failed(
|
||||||
clear_buffer_mapped(bh);
|
clear_buffer_mapped(bh);
|
||||||
clear_buffer_new(bh);
|
clear_buffer_new(bh);
|
||||||
clear_buffer_dirty(bh);
|
clear_buffer_dirty(bh);
|
||||||
|
clear_buffer_unwritten(bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,5 @@ extern int xfs_fs_counts(xfs_mount_t *mp, xfs_fsop_counts_t *cnt);
|
||||||
extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
|
extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
|
||||||
xfs_fsop_resblks_t *outval);
|
xfs_fsop_resblks_t *outval);
|
||||||
extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
|
extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
|
||||||
extern int xfs_fs_log_dummy(struct xfs_mount *mp);
|
|
||||||
|
|
||||||
#endif /* __XFS_FSOPS_H__ */
|
#endif /* __XFS_FSOPS_H__ */
|
||||||
|
|
|
@ -327,7 +327,6 @@ extern int xfs_mod_fdblocks(struct xfs_mount *mp, int64_t delta,
|
||||||
bool reserved);
|
bool reserved);
|
||||||
extern int xfs_mod_frextents(struct xfs_mount *mp, int64_t delta);
|
extern int xfs_mod_frextents(struct xfs_mount *mp, int64_t delta);
|
||||||
|
|
||||||
extern int xfs_mount_log_sb(xfs_mount_t *);
|
|
||||||
extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
|
extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
|
||||||
extern int xfs_readsb(xfs_mount_t *, int);
|
extern int xfs_readsb(xfs_mount_t *, int);
|
||||||
extern void xfs_freesb(xfs_mount_t *);
|
extern void xfs_freesb(xfs_mount_t *);
|
||||||
|
|
|
@ -497,6 +497,7 @@ xfsaild(
|
||||||
long tout = 0; /* milliseconds */
|
long tout = 0; /* milliseconds */
|
||||||
|
|
||||||
current->flags |= PF_MEMALLOC;
|
current->flags |= PF_MEMALLOC;
|
||||||
|
set_freezable();
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
if (tout && tout <= 20)
|
if (tout && tout <= 20)
|
||||||
|
@ -519,14 +520,14 @@ xfsaild(
|
||||||
if (!xfs_ail_min(ailp) &&
|
if (!xfs_ail_min(ailp) &&
|
||||||
ailp->xa_target == ailp->xa_target_prev) {
|
ailp->xa_target == ailp->xa_target_prev) {
|
||||||
spin_unlock(&ailp->xa_lock);
|
spin_unlock(&ailp->xa_lock);
|
||||||
schedule();
|
freezable_schedule();
|
||||||
tout = 0;
|
tout = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
spin_unlock(&ailp->xa_lock);
|
spin_unlock(&ailp->xa_lock);
|
||||||
|
|
||||||
if (tout)
|
if (tout)
|
||||||
schedule_timeout(msecs_to_jiffies(tout));
|
freezable_schedule_timeout(msecs_to_jiffies(tout));
|
||||||
|
|
||||||
__set_current_state(TASK_RUNNING);
|
__set_current_state(TASK_RUNNING);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче