ext2,3,4: provide simple rcu-walk ACL implementation
authorNick Piggin <npiggin@kernel.dk>
Fri, 7 Jan 2011 06:50:00 +0000 (17:50 +1100)
committerNick Piggin <npiggin@kernel.dk>
Fri, 7 Jan 2011 06:50:30 +0000 (17:50 +1100)
This simple implementation just checks for no ACLs on the inode, and
if so, then the rcu-walk may proceed, otherwise fail it.

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
fs/ext2/acl.c
fs/ext3/acl.c
fs/ext4/acl.c

index dd9bb3f0c8d7d15a89d806fcca1272d295edfbc0..7b4180554a62a3c9ce2807487477d93485602bf3 100644 (file)
@@ -236,8 +236,11 @@ ext2_check_acl(struct inode *inode, int mask, unsigned int flags)
 {
        struct posix_acl *acl;
 
-       if (flags & IPERM_FLAG_RCU)
-               return -ECHILD;
+       if (flags & IPERM_FLAG_RCU) {
+               if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
+                       return -ECHILD;
+               return -EAGAIN;
+       }
 
        acl = ext2_get_acl(inode, ACL_TYPE_ACCESS);
        if (IS_ERR(acl))
index 9e49da8302d395c98ed3296b1f5c001c7a44c393..e4fa49e6c539310c2a4c67de8ae8fb7f647c7ec2 100644 (file)
@@ -244,8 +244,11 @@ ext3_check_acl(struct inode *inode, int mask, unsigned int flags)
 {
        struct posix_acl *acl;
 
-       if (flags & IPERM_FLAG_RCU)
-               return -ECHILD;
+       if (flags & IPERM_FLAG_RCU) {
+               if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
+                       return -ECHILD;
+               return -EAGAIN;
+       }
 
        acl = ext3_get_acl(inode, ACL_TYPE_ACCESS);
        if (IS_ERR(acl))
index 373dcaeedba921e5c5a02eef301f7e99f5b4d9e4..e0270d1f8d82b68e8823cccc4db7539fb9a34f5b 100644 (file)
@@ -242,8 +242,11 @@ ext4_check_acl(struct inode *inode, int mask, unsigned int flags)
 {
        struct posix_acl *acl;
 
-       if (flags & IPERM_FLAG_RCU)
-               return -ECHILD;
+       if (flags & IPERM_FLAG_RCU) {
+               if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
+                       return -ECHILD;
+               return -EAGAIN;
+       }
 
        acl = ext4_get_acl(inode, ACL_TYPE_ACCESS);
        if (IS_ERR(acl))