Whamcloud - gitweb
LU-245 too many default ACLs break directory access on new directories
authorBobi Jam <bobijam@whamcloud.com>
Thu, 28 Apr 2011 07:17:49 +0000 (15:17 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 7 Jun 2011 00:41:21 +0000 (17:41 -0700)
The attached patch was a result of the discussion with Andreas Dilger
on lustre discuss starting here:
http://lists.lustre.org/pipermail/lustre-discuss/2010-May/013177.html

Change-Id: I0f66d3587d25f0c9c3862498326a2c26acc57b3e
Bugzilla: 22820
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/471
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_xattr.c

index 0db7f33..6cfb1e2 100644 (file)
@@ -282,7 +282,7 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
         struct mdt_reint_record *rr   = &info->mti_rr;
         struct md_attr          *ma = &info->mti_attr;
         struct lu_attr          *attr = &info->mti_attr.ma_attr;
-        struct mdt_object       *obj; 
+        struct mdt_object       *obj;
         struct md_object        *child;
         __u64                    valid = attr->la_valid;
         const char              *xattr_name;
@@ -335,7 +335,9 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
                         GOTO(out, rc = 0);
         } else if ((valid & OBD_MD_FLXATTR) &&
                    (strncmp(xattr_name, XATTR_NAME_ACL_ACCESS,
-                             sizeof(XATTR_NAME_ACL_ACCESS) - 1) == 0)) {
+                            sizeof(XATTR_NAME_ACL_ACCESS) - 1) == 0 ||
+                    strncmp(xattr_name, XATTR_NAME_ACL_DEFAULT,
+                            sizeof(XATTR_NAME_ACL_DEFAULT) - 1) == 0)) {
                 /* currently lustre limit acl access size */
                 xattr_len = req_capsule_get_size(pill, &RMF_EADATA, RCL_CLIENT);
 
@@ -344,6 +346,12 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
         }
 
         lockpart = MDS_INODELOCK_UPDATE;
+        /* Revoke all clients' lookup lock, since the access
+         * permissions for this inode is changed when ACL_ACCESS is
+         * set. This isn't needed for ACL_DEFAULT, since that does
+         * not change the access permissions of this inode, nor any
+         * other existing inodes. It is setting the ACLs inherited
+         * by new directories/files at create time. */
         if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS))
                 lockpart |= MDS_INODELOCK_LOOKUP;