]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
generic/159, 160: deal with EACCES -> EPERM transition
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 25 Aug 2016 23:28:44 +0000 (16:28 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 2 Sep 2016 08:40:34 +0000 (16:40 +0800)
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>
tests/generic/159
tests/generic/160

index 8898d58b5123e2c71070ca5bb1133c6d978d5ab2..5e1a899ffd668661003a443cd1d2f423a79d77c2 100755 (executable)
@@ -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
index 3a91dc81627627e174328ea09e3e2ed8b5919663..1dc5b723c78e14245e6e0a8f4aa8de8344b304ae 100755 (executable)
@@ -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