xfs: cache negative ACLs if there is no attribute fork
authorChristoph Hellwig <hch@lst.de>
Sat, 23 Jul 2011 15:36:50 +0000 (17:36 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 25 Jul 2011 18:25:38 +0000 (14:25 -0400)
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>
fs/xfs/linux-2.6/xfs_acl.c
fs/xfs/linux-2.6/xfs_iops.c

index f6d065ac56b596dc0d9c89f7ebff0998645b2dd2..13c4e4fd5c6eda7007d9a607b6bc7981c95888cb 100644 (file)
@@ -221,21 +221,10 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 int
 xfs_check_acl(struct inode *inode, int mask)
 {
-       struct xfs_inode *ip;
        struct posix_acl *acl;
        int error = -EAGAIN;
 
-       ip = XFS_I(inode);
-       trace_xfs_check_acl(ip);
-
-       /*
-        * If there is no attribute fork no ACL exists on this inode and
-        * we can skip the whole exercise.
-        *
-        * FIXME! Fill the cache! Locking?
-        */
-       if (!XFS_IFORK_Q(ip))
-               return -EAGAIN;
+       trace_xfs_check_acl(XFS_I(inode));
 
        acl = xfs_get_acl(inode, ACL_TYPE_ACCESS);
        if (IS_ERR(acl))
index 501e4f630548ad7a4ffd50f78fbc91faf55d0241..de666917db0667b4d98fb930720c8720e3af47a2 100644 (file)
@@ -1194,6 +1194,10 @@ xfs_setup_inode(
                break;
        }
 
+       /* if there is no attribute fork no ACL can exist on this inode */
+       if (!XFS_IFORK_Q(ip))
+               cache_no_acl(inode);
+
        xfs_iflags_clear(ip, XFS_INEW);
        barrier();