xfs
[Top] [All Lists]

[PATCH 04/13] generic/159, 160: deal with EACCESS -> EPERM transition

To: david@xxxxxxxxxxxxx, eguan@xxxxxxxxxx, darrick.wong@xxxxxxxxxx
Subject: [PATCH 04/13] generic/159, 160: deal with EACCESS -> EPERM transition
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Thu, 25 Aug 2016 16:28:44 -0700
Cc: linux-xfs@xxxxxxxxxxxxxxx, fstests@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <147216769914.32641.55434969009554013.stgit@xxxxxxxxxxxxxxxx>
References: <147216769914.32641.55434969009554013.stgit@xxxxxxxxxxxxxxxx>
User-agent: StGit/0.17.1-dirty
As of 4.8 we can receive EPERM (instead of EACCESS) 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@xxxxxxxxxx>
---
 tests/generic/159 |    6 +++++-
 tests/generic/160 |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)


diff --git a/tests/generic/159 b/tests/generic/159
index 8898d58..726333a 100755
--- a/tests/generic/159
+++ b/tests/generic/159
@@ -65,9 +65,13 @@ _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 3a91dc8..4946bfc 100755
--- a/tests/generic/160
+++ b/tests/generic/160
@@ -65,9 +65,13 @@ _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

<Prev in Thread] Current Thread [Next in Thread>