Whamcloud - gitweb
EX-3409 revert: "pcc: add owner capacity check for open attach"
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 2 Sep 2021 03:22:34 +0000 (21:22 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 2 Sep 2021 15:08:45 +0000 (15:08 +0000)
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 <adilger@whamcloud.com>
Change-Id: Ib562f2c62acf3ed564309fa8ae56ba21bd31577c
Reviewed-on: https://review.whamcloud.com/44816
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
contrib/git-hooks/commit-msg
lustre/llite/pcc.c
lustre/tests/sanity-pcc.sh

index b93c796..cabbba5 100755 (executable)
@@ -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\} "
 
index f3e68e4..3654dfd 100644 (file)
@@ -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)
index a9381df..44d9b71 100644 (file)
@@ -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"