diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-08-25 16:28:44 -0700 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2016-09-02 16:40:34 +0800 |
commit | 297985bfeb75afc051b60e5ca444e4e44fbb4694 (patch) | |
tree | 36bb55b7ef3b0b7c63f9c3d2bd6dc6b6a3d15e6e | |
parent | acede2049ad0ca2d5726460317abea72b1aff223 (diff) | |
download | xfstests-dev-297985bfeb75afc051b60e5ca444e4e44fbb4694.tar.gz |
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 <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-x | tests/generic/159 | 7 | ||||
-rwxr-xr-x | tests/generic/160 | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/generic/159 b/tests/generic/159 index 8898d58b51..5e1a899ffd 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 3a91dc8162..1dc5b723c7 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 |