Whamcloud - gitweb
LU-18388 llite: handle -EOPNOTSUPP in get_inode_acl 56/56756/6
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 7 Nov 2024 04:32:40 +0000 (11:32 +0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 2 Dec 2024 05:54:16 +0000 (05:54 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I208e7e6095c19728643a6d208becd448ed2e2539
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56756
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/acl.c

index 9fa960d..213e019 100644 (file)
@@ -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