aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-23 11:36:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-25 14:25:38 -0400
commit6311b10800a4bdc3f2c85d01fb113cf49bb83770 (patch)
tree4798068e025fa64c9c8656e2a28427f120d447a0 /fs
parentebbb0ef2871bf3f529987313a9146cc42419a8a8 (diff)
xfs: cache negative ACLs if there is no attribute fork
Always set up a negative ACL cache entry if the inode doesn't have an attribute fork. That behaves much better than doing this check inside ->check_acl. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_acl.c13
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c4
2 files changed, 5 insertions, 12 deletions
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
index f6d065ac56b5..13c4e4fd5c6e 100644
--- a/fs/xfs/linux-2.6/xfs_acl.c
+++ b/fs/xfs/linux-2.6/xfs_acl.c
@@ -221,21 +221,10 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
221int 221int
222xfs_check_acl(struct inode *inode, int mask) 222xfs_check_acl(struct inode *inode, int mask)
223{ 223{
224 struct xfs_inode *ip;
225 struct posix_acl *acl; 224 struct posix_acl *acl;
226 int error = -EAGAIN; 225 int error = -EAGAIN;
227 226
228 ip = XFS_I(inode); 227 trace_xfs_check_acl(XFS_I(inode));
229 trace_xfs_check_acl(ip);
230
231 /*
232 * If there is no attribute fork no ACL exists on this inode and
233 * we can skip the whole exercise.
234 *
235 * FIXME! Fill the cache! Locking?
236 */
237 if (!XFS_IFORK_Q(ip))
238 return -EAGAIN;
239 228
240 acl = xfs_get_acl(inode, ACL_TYPE_ACCESS); 229 acl = xfs_get_acl(inode, ACL_TYPE_ACCESS);
241 if (IS_ERR(acl)) 230 if (IS_ERR(acl))
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 501e4f630548..de666917db06 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -1194,6 +1194,10 @@ 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 */
1198 if (!XFS_IFORK_Q(ip))
1199 cache_no_acl(inode);
1200
1197 xfs_iflags_clear(ip, XFS_INEW); 1201 xfs_iflags_clear(ip, XFS_INEW);
1198 barrier(); 1202 barrier();
1199 1203