From 3eb037e3edc4bb5354315a0ff7e1e55a26453d70 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 1 Sep 2021 21:22:34 -0600 Subject: [PATCH] EX-3409 revert: "pcc: add owner capacity check for open attach" This reverts commit 7cce3772e267afee328d63da9367875c63e6ad43, since this prevented users with read permission on a file to auto-attach or manually attach the file into the local cache. Test-Parameters: trivial testlist=sanity-pcc Signed-off-by: Andreas Dilger Change-Id: Ib562f2c62acf3ed564309fa8ae56ba21bd31577c Reviewed-on: https://review.whamcloud.com/44816 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yingjin Qian --- contrib/git-hooks/commit-msg | 4 ++-- lustre/llite/pcc.c | 2 +- lustre/tests/sanity-pcc.sh | 23 ----------------------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/contrib/git-hooks/commit-msg b/contrib/git-hooks/commit-msg index b93c796..cabbba5 100755 --- a/contrib/git-hooks/commit-msg +++ b/contrib/git-hooks/commit-msg @@ -28,8 +28,8 @@ init() { Reviewed-by \ CC \ | tr ' ' '|') - readonly WIDTH_SUM=62 - readonly WIDTH_REG=70 + readonly WIDTH_SUM=${WIDTH_SUM:-62} + readonly WIDTH_REG=${WIDTH_REG:-70} readonly JIRA_FMT_A="^[A-Z]\{2,9\}-[0-9]\{1,5\} [-a-z0-9]\{2,11\}: " readonly JIRA_FMT_B="^[A-Z]\{2,9\}-[0-9]\{1,5\} " diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index f3e68e4..3654dfd 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -2270,7 +2270,7 @@ int pcc_file_open(struct inode *inode, struct file *file) if (pcc_may_auto_attach(inode, PIT_OPEN)) rc = pcc_try_auto_attach(inode, &cached, PIT_OPEN); - if (rc == 0 && !cached && inode_owner_or_capable(inode)) + if (rc == 0 && !cached) rc = pcc_try_readonly_open_attach(inode, file, &cached); if (rc < 0) diff --git a/lustre/tests/sanity-pcc.sh b/lustre/tests/sanity-pcc.sh index a9381df..44d9b71 100644 --- a/lustre/tests/sanity-pcc.sh +++ b/lustre/tests/sanity-pcc.sh @@ -3323,29 +3323,6 @@ test_42() { } run_test 42 "PCC attach without attach ID specified" -test_43() { - local loopfile="$TMP/$tfile" - local mntpt="/mnt/pcc.$tdir" - local hsm_root="$mntpt/$tdir" - local file=$DIR/$tfile - - setup_loopdev $SINGLEAGT $loopfile $mntpt 60 - do_facet $SINGLEAGT mkdir $hsm_root || error "mkdir $hsm_root failed" - setup_pcc_mapping $SINGLEAGT \ - "size\<{100M}\ roid=$HSM_ARCHIVE_NUMBER\ ropcc=1" - do_facet $SINGLEAGT $LCTL pcc list $MOUNT - - echo "attach_root_user_data" > $file || error "echo $file failed" - - do_facet $SINGLEAGT $LFS pcc state $file - # Attach by non-root user should fail. - do_facet $SINGLEAGT $RUNAS $LFS pcc attach -r $file && - error "PCC attach -r $file should fail for non-root user" - do_facet $SINGLEAGT $RUNAS $LFS pcc state $file - check_lpcc_state $file "none" -} -run_test 43 "Auto attach at open() should add capacity owner check" - test_44() { local loopfile="$TMP/$tfile" local mntpt="/mnt/pcc.$tdir" -- 1.8.3.1