From: Darrick J. Wong Date: Thu, 25 Aug 2016 23:28:44 +0000 (-0700) Subject: generic/159, 160: deal with EACCES -> EPERM transition X-Git-Tag: v2022.05.01~2372 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=297985bfeb75afc051b60e5ca444e4e44fbb4694;p=users%2Fhch%2Fxfstests-dev.git generic/159, 160: deal with EACCES -> EPERM transition As of 4.8 we can receive EPERM (instead of EACCES) for attempts to reflink/dedupe to an immutable file. Fix this up so that we accept either answer. Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/generic/159 b/tests/generic/159 index 8898d58b5..5e1a899ff 100755 --- a/tests/generic/159 +++ b/tests/generic/159 @@ -65,9 +65,14 @@ _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full sync +do_filter_output() +{ + _filter_test_dir | sed -e 's/Operation not permitted/Permission denied/g' +} + echo "Try reflink on immutable files" $CHATTR_PROG +i $testdir1/file1 $testdir1/file2 -_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir +_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | do_filter_output $CHATTR_PROG -i $testdir1/file1 $testdir1/file2 # success, all done diff --git a/tests/generic/160 b/tests/generic/160 index 3a91dc816..1dc5b723c 100755 --- a/tests/generic/160 +++ b/tests/generic/160 @@ -65,9 +65,14 @@ _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full sync +do_filter_output() +{ + _filter_test_dir | sed -e 's/Operation not permitted/Permission denied/g' +} + echo "Try dedupe on immutable files" $CHATTR_PROG +i $testdir1/file1 $testdir1/file2 -_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir +_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | do_filter_output $CHATTR_PROG -i $testdir1/file1 $testdir1/file2 # success, all done