Whamcloud - gitweb
LU-18070 sec: clear ACL caches if ACL empty 00/56600/5
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 7 Oct 2024 16:13:41 +0000 (18:13 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 11 Oct 2024 20:39:13 +0000 (20:39 +0000)
When the lli_posix_acl field of struct ll_inode_info is updated,
check if new ACL is empty, and clear ACL caches for this inode
in this case.

Also fix sanity test_103a when it is run with multiple MDTs. The
test has several requirements regarding uids and gids, but in case
they are not met, missing ids are only configured on mds1. So make
sure the directory used for the test ($DIR/$tdir) is created on mds1.

Fixes: 13fd5ebef3 ("LU-18101 sec: fix ACL handling on recent kernels again")
Fixes: aa636f8ae6 ("LU-18095 sec: fix ACL handling on recent kernels")
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
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I91109bf98bc65dfb1fcefb2551be84d9c73f8ee2
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56600
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_internal.h
lustre/tests/sanity.sh

index 9515d55..15a981f 100644 (file)
@@ -493,6 +493,10 @@ static inline void lli_replace_acl(struct ll_inode_info *lli,
        if (lli->lli_posix_acl)
                posix_acl_release(lli->lli_posix_acl);
        lli->lli_posix_acl = acl;
+       if (!acl) {
+               forget_cached_acl(&lli->lli_vfs_inode, ACL_TYPE_ACCESS);
+               forget_cached_acl(&lli->lli_vfs_inode, ACL_TYPE_DEFAULT);
+       }
        write_unlock(&lli->lli_lock);
 }
 #else
index 4fa0c46..8825f32 100755 (executable)
@@ -13299,7 +13299,7 @@ test_103a() {
 
        SAVE_UMASK=$(umask)
        umask 0022
-       mkdir -p $DIR/$tdir
+       $LFS mkdir -c1 -i0 $DIR/$tdir
        cd $DIR/$tdir
 
        run_acl_subtest cp $ACLBIN $ACLDMN $ACLGRP