RCUify freeing acls, let check_acl() go ahead in RCU mode if acl is cached
[deliverable/linux.git] / fs / namei.c
index 445fd5da11fa9f366458247c842d68dacb147c87..3d607bd80e09f683fac132d6387f152c1df11f4c 100644 (file)
@@ -179,19 +179,14 @@ static int check_acl(struct inode *inode, int mask)
 #ifdef CONFIG_FS_POSIX_ACL
        struct posix_acl *acl;
 
-       /*
-        * Under RCU walk, we cannot even do a "get_cached_acl()",
-        * because that involves locking and getting a refcount on
-        * a cached ACL.
-        *
-        * So the only case we handle during RCU walking is the
-        * case of a cached "no ACL at all", which needs no locks
-        * or refcounts.
-        */
        if (mask & MAY_NOT_BLOCK) {
-               if (negative_cached_acl(inode, ACL_TYPE_ACCESS))
+               acl = get_cached_acl_rcu(inode, ACL_TYPE_ACCESS);
+               if (!acl)
                        return -EAGAIN;
-               return -ECHILD;
+               /* no ->get_acl() calls in RCU mode... */
+               if (acl == ACL_NOT_CACHED)
+                       return -ECHILD;
+               return posix_acl_permission(inode, acl, mask);
        }
 
        acl = get_cached_acl(inode, ACL_TYPE_ACCESS);
This page took 0.027798 seconds and 5 git commands to generate.