From 659bb1d704317346ebfde1899c8ee8b38c9c3f80 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Mon, 7 Oct 2024 18:13:41 +0200 Subject: [PATCH] LU-18070 sec: clear ACL caches if ACL empty 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 Change-Id: I91109bf98bc65dfb1fcefb2551be84d9c73f8ee2 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56600 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/llite/llite_internal.h | 4 ++++ lustre/tests/sanity.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 9515d55..15a981f 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -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 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4fa0c46..8825f32 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 -- 1.8.3.1