From: Shaun Tancheff Date: Thu, 7 Nov 2024 04:32:40 +0000 (+0700) Subject: LU-18388 llite: handle -EOPNOTSUPP in get_inode_acl X-Git-Tag: 2.16.51~139 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7e457159a097d69e76097c55c75546163a44befa;p=fs%2Flustre-release.git LU-18388 llite: handle -EOPNOTSUPP in get_inode_acl When ll_xattr_list returns -EOPNOTSUPP [-95] NULL should be returned to avoid sanity failing to run as non-root users with: operation mds_getxattr to node 192.168.122.50@tcp failed: rc = -95 Test-Parameters: testlist=sanity env=ONLY=103a,ONLY_REPEAT=10 mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 clientdistro=sles15sp6 serverdistro=el8.8 Test-Parameters: testlist=sanity env=ONLY=103a,ONLY_REPEAT=10 mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 clientdistro=ubuntu2404 serverdistro=el8.8 Test-Parameters: testlist=sanity env=ONLY=103a,ONLY_REPEAT=10 mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 clientdistro=el9.3 serverdistro=el8.8 Test-Parameters: testlist=sanityn env=ONLY=25a,ONLY_REPEAT=10 mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 clientdistro=ubuntu2404 serverdistro=el8.8 Test-Parameters: testlist=sanity-sec env=ONLY=23b,ONLY_REPEAT=50 mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 clientdistro=ubuntu2404 serverdistro=el8.8 Fixes: 13fd5ebef3 ("LU-18101 sec: fix ACL handling on recent kernels again") Signed-off-by: Shaun Tancheff Change-Id: I208e7e6095c19728643a6d208becd448ed2e2539 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56756 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Jian Yu Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/acl.c b/lustre/llite/acl.c index 9fa960d..213e019 100644 --- a/lustre/llite/acl.c +++ b/lustre/llite/acl.c @@ -38,8 +38,8 @@ #include "llite_internal.h" -struct posix_acl * -ll_get_inode_acl(struct inode *inode, int type, bool rcu) +static struct posix_acl * +ll_get_acl_common(struct inode *inode, int type, bool rcu) { struct ll_inode_info *lli = ll_i2info(inode); struct posix_acl *acl = NULL; @@ -81,7 +81,7 @@ ll_get_inode_acl(struct inode *inode, int type, bool rcu) } if (len > 0) acl = posix_acl_from_xattr(&init_user_ns, value, len); - else if (len == -ENODATA || len == -ENOSYS) + else if (len == -ENODATA || len == -ENOSYS || len == -EOPNOTSUPP) acl = NULL; else acl = ERR_PTR(len); @@ -107,6 +107,12 @@ out: RETURN(acl); } +/* v6.1-rc1-3-gcac2f8b8d8b5 */ +struct posix_acl *ll_get_inode_acl(struct inode *inode, int type, bool rcu) +{ + return ll_get_acl_common(inode, type, rcu); +} + struct posix_acl *ll_get_acl( #ifdef HAVE_ACL_WITH_DENTRY struct mnt_idmap *map, struct dentry *dentry, int type) @@ -123,7 +129,7 @@ struct posix_acl *ll_get_acl( bool rcu = false; #endif - return ll_get_inode_acl(inode, type, rcu); + return ll_get_acl_common(inode, type, rcu); } #ifdef HAVE_IOP_SET_ACL