From 826914258308661fbf39e08c1712a53b1189d48a Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Wed, 15 Sep 2010 21:28:02 +0400 Subject: [PATCH] b=22820 too many default ACLs break directory access on new directories 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 a=Frederik Ferner i=Johann Lombardi i=Andreas Dilger --- lustre/mds/mds_xattr.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/mds/mds_xattr.c b/lustre/mds/mds_xattr.c index cd84bc5..97fb9db 100644 --- a/lustre/mds/mds_xattr.c +++ b/lustre/mds/mds_xattr.c @@ -60,6 +60,10 @@ #define XATTR_NAME_ACL_ACCESS "system.posix_acl_access" #endif +#ifndef XATTR_NAME_ACL_DEFAULT +#define XATTR_NAME_ACL_DEFAULT "system.posix_acl_default" +#endif + static int mds_getxattr_pack_msg(struct ptlrpc_request *req, struct dentry *de, struct mds_body *body) @@ -270,7 +274,9 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body) } /* currently lustre limit xattr size */ - if (body->valid & OBD_MD_FLXATTR && !strcmp(xattr_name, XATTR_NAME_ACL_ACCESS)) { + if (body->valid & OBD_MD_FLXATTR && + (strcmp(xattr_name, XATTR_NAME_ACL_ACCESS) == 0 || + strcmp(xattr_name, XATTR_NAME_ACL_DEFAULT) == 0 )) { xattrlen = lustre_msg_buflen(req->rq_reqmsg, REQ_REC_OFF + 2); @@ -278,7 +284,12 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body) GOTO(out, -ERANGE); } - + /* 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; -- 1.8.3.1