Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: optimize the negative xattr caching xfs: prevent against ioend livelocks in xfs_file_fsync xfs: flag all buffers as metadata xfs: encapsulate a block of debug code
This commit is contained in:
commit
597a67e0ba
@ -1224,6 +1224,9 @@ _xfs_buf_ioapply(
|
|||||||
rw = READ;
|
rw = READ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we only use the buffer cache for meta-data */
|
||||||
|
rw |= REQ_META;
|
||||||
|
|
||||||
next_chunk:
|
next_chunk:
|
||||||
atomic_inc(&bp->b_io_remaining);
|
atomic_inc(&bp->b_io_remaining);
|
||||||
nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
|
nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
|
||||||
|
@ -149,7 +149,9 @@ xfs_file_fsync(
|
|||||||
|
|
||||||
xfs_iflags_clear(ip, XFS_ITRUNCATED);
|
xfs_iflags_clear(ip, XFS_ITRUNCATED);
|
||||||
|
|
||||||
|
xfs_ilock(ip, XFS_IOLOCK_SHARED);
|
||||||
xfs_ioend_wait(ip);
|
xfs_ioend_wait(ip);
|
||||||
|
xfs_iunlock(ip, XFS_IOLOCK_SHARED);
|
||||||
|
|
||||||
if (mp->m_flags & XFS_MOUNT_BARRIER) {
|
if (mp->m_flags & XFS_MOUNT_BARRIER) {
|
||||||
/*
|
/*
|
||||||
|
@ -1194,9 +1194,14 @@ xfs_setup_inode(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if there is no attribute fork no ACL can exist on this inode */
|
/*
|
||||||
if (!XFS_IFORK_Q(ip))
|
* If there is no attribute fork no ACL can exist on this inode,
|
||||||
|
* and it can't have any file capabilities attached to it either.
|
||||||
|
*/
|
||||||
|
if (!XFS_IFORK_Q(ip)) {
|
||||||
|
inode_has_no_xattr(inode);
|
||||||
cache_no_acl(inode);
|
cache_no_acl(inode);
|
||||||
|
}
|
||||||
|
|
||||||
xfs_iflags_clear(ip, XFS_INEW);
|
xfs_iflags_clear(ip, XFS_INEW);
|
||||||
barrier();
|
barrier();
|
||||||
|
@ -692,6 +692,24 @@ xfs_da_join(xfs_da_state_t *state)
|
|||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static void
|
||||||
|
xfs_da_blkinfo_onlychild_validate(struct xfs_da_blkinfo *blkinfo, __u16 level)
|
||||||
|
{
|
||||||
|
__be16 magic = blkinfo->magic;
|
||||||
|
|
||||||
|
if (level == 1) {
|
||||||
|
ASSERT(magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
|
||||||
|
magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
|
||||||
|
} else
|
||||||
|
ASSERT(magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
|
||||||
|
ASSERT(!blkinfo->forw);
|
||||||
|
ASSERT(!blkinfo->back);
|
||||||
|
}
|
||||||
|
#else /* !DEBUG */
|
||||||
|
#define xfs_da_blkinfo_onlychild_validate(blkinfo, level)
|
||||||
|
#endif /* !DEBUG */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have only one entry in the root. Copy the only remaining child of
|
* We have only one entry in the root. Copy the only remaining child of
|
||||||
* the old root to block 0 as the new root node.
|
* the old root to block 0 as the new root node.
|
||||||
@ -700,8 +718,6 @@ STATIC int
|
|||||||
xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
|
xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
|
||||||
{
|
{
|
||||||
xfs_da_intnode_t *oldroot;
|
xfs_da_intnode_t *oldroot;
|
||||||
/* REFERENCED */
|
|
||||||
xfs_da_blkinfo_t *blkinfo;
|
|
||||||
xfs_da_args_t *args;
|
xfs_da_args_t *args;
|
||||||
xfs_dablk_t child;
|
xfs_dablk_t child;
|
||||||
xfs_dabuf_t *bp;
|
xfs_dabuf_t *bp;
|
||||||
@ -732,15 +748,9 @@ xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
|
|||||||
if (error)
|
if (error)
|
||||||
return(error);
|
return(error);
|
||||||
ASSERT(bp != NULL);
|
ASSERT(bp != NULL);
|
||||||
blkinfo = bp->data;
|
xfs_da_blkinfo_onlychild_validate(bp->data,
|
||||||
if (be16_to_cpu(oldroot->hdr.level) == 1) {
|
be16_to_cpu(oldroot->hdr.level));
|
||||||
ASSERT(blkinfo->magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
|
|
||||||
blkinfo->magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
|
|
||||||
} else {
|
|
||||||
ASSERT(blkinfo->magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
|
|
||||||
}
|
|
||||||
ASSERT(!blkinfo->forw);
|
|
||||||
ASSERT(!blkinfo->back);
|
|
||||||
memcpy(root_blk->bp->data, bp->data, state->blocksize);
|
memcpy(root_blk->bp->data, bp->data, state->blocksize);
|
||||||
xfs_da_log_buf(args->trans, root_blk->bp, 0, state->blocksize - 1);
|
xfs_da_log_buf(args->trans, root_blk->bp, 0, state->blocksize - 1);
|
||||||
error = xfs_da_shrink_inode(args, child, bp);
|
error = xfs_da_shrink_inode(args, child, bp);
|
||||||
|
Loading…
Reference in New Issue
Block a user