aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 16:41:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 16:41:51 -0400
commit597a67e0ba758e3d2239c81fbb648c6e69ec30a2 (patch)
treee2b6146df41943e7f87168fe3f5825722b434223 /fs
parent28890d3598c352ae065b560e0fded3e79c800ba1 (diff)
parent510792ee29770a38dd409bf2b469ade2fea9eb52 (diff)
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
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c9
-rw-r--r--fs/xfs/xfs_da_btree.c32
4 files changed, 33 insertions, 13 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b2b411985591..d1fe74506c4c 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1224,6 +1224,9 @@ _xfs_buf_ioapply(
1224 rw = READ; 1224 rw = READ;
1225 } 1225 }
1226 1226
1227 /* we only use the buffer cache for meta-data */
1228 rw |= REQ_META;
1229
1227next_chunk: 1230next_chunk:
1228 atomic_inc(&bp->b_io_remaining); 1231 atomic_inc(&bp->b_io_remaining);
1229 nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT); 1232 nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT);
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 825390e1c138..7f7b42469ea7 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -149,7 +149,9 @@ xfs_file_fsync(
149 149
150 xfs_iflags_clear(ip, XFS_ITRUNCATED); 150 xfs_iflags_clear(ip, XFS_ITRUNCATED);
151 151
152 xfs_ilock(ip, XFS_IOLOCK_SHARED);
152 xfs_ioend_wait(ip); 153 xfs_ioend_wait(ip);
154 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
153 155
154 if (mp->m_flags & XFS_MOUNT_BARRIER) { 156 if (mp->m_flags & XFS_MOUNT_BARRIER) {
155 /* 157 /*
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 6544c3236bc8..b9c172b3fbbe 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -1194,9 +1194,14 @@ xfs_setup_inode(
1194 break; 1194 break;
1195 } 1195 }
1196 1196
1197 /* if there is no attribute fork no ACL can exist on this inode */ 1197 /*
1198 if (!XFS_IFORK_Q(ip)) 1198 * If there is no attribute fork no ACL can exist on this inode,
1199 * and it can't have any file capabilities attached to it either.
1200 */
1201 if (!XFS_IFORK_Q(ip)) {
1202 inode_has_no_xattr(inode);
1199 cache_no_acl(inode); 1203 cache_no_acl(inode);
1204 }
1200 1205
1201 xfs_iflags_clear(ip, XFS_INEW); 1206 xfs_iflags_clear(ip, XFS_INEW);
1202 barrier(); 1207 barrier();
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 2925726529f8..5bfcb8779f9f 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -692,6 +692,24 @@ xfs_da_join(xfs_da_state_t *state)
692 return(error); 692 return(error);
693} 693}
694 694
695#ifdef DEBUG
696static void
697xfs_da_blkinfo_onlychild_validate(struct xfs_da_blkinfo *blkinfo, __u16 level)
698{
699 __be16 magic = blkinfo->magic;
700
701 if (level == 1) {
702 ASSERT(magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
703 magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
704 } else
705 ASSERT(magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
706 ASSERT(!blkinfo->forw);
707 ASSERT(!blkinfo->back);
708}
709#else /* !DEBUG */
710#define xfs_da_blkinfo_onlychild_validate(blkinfo, level)
711#endif /* !DEBUG */
712
695/* 713/*
696 * We have only one entry in the root. Copy the only remaining child of 714 * We have only one entry in the root. Copy the only remaining child of
697 * the old root to block 0 as the new root node. 715 * the old root to block 0 as the new root node.
@@ -700,8 +718,6 @@ STATIC int
700xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk) 718xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
701{ 719{
702 xfs_da_intnode_t *oldroot; 720 xfs_da_intnode_t *oldroot;
703 /* REFERENCED */
704 xfs_da_blkinfo_t *blkinfo;
705 xfs_da_args_t *args; 721 xfs_da_args_t *args;
706 xfs_dablk_t child; 722 xfs_dablk_t child;
707 xfs_dabuf_t *bp; 723 xfs_dabuf_t *bp;
@@ -732,15 +748,9 @@ xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
732 if (error) 748 if (error)
733 return(error); 749 return(error);
734 ASSERT(bp != NULL); 750 ASSERT(bp != NULL);
735 blkinfo = bp->data; 751 xfs_da_blkinfo_onlychild_validate(bp->data,
736 if (be16_to_cpu(oldroot->hdr.level) == 1) { 752 be16_to_cpu(oldroot->hdr.level));
737 ASSERT(blkinfo->magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || 753
738 blkinfo->magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
739 } else {
740 ASSERT(blkinfo->magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
741 }
742 ASSERT(!blkinfo->forw);
743 ASSERT(!blkinfo->back);
744 memcpy(root_blk->bp->data, bp->data, state->blocksize); 754 memcpy(root_blk->bp->data, bp->data, state->blocksize);
745 xfs_da_log_buf(args->trans, root_blk->bp, 0, state->blocksize - 1); 755 xfs_da_log_buf(args->trans, root_blk->bp, 0, state->blocksize - 1);
746 error = xfs_da_shrink_inode(args, child, bp); 756 error = xfs_da_shrink_inode(args, child, bp);