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>
This commit is contained in:
Darrick J. Wong
2016-08-25 16:28:44 -07:00
committed by Eryu Guan
parent acede2049a
commit 297985bfeb
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -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
+6 -1
View File
@@ -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