public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/554: test only copy to active swap file
@ 2019-06-10 19:53 Amir Goldstein
  2019-06-11  3:19 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Goldstein @ 2019-06-10 19:53 UTC (permalink / raw)
  To: Eryu Guan
  Cc: Darrick J . Wong, Dave Chinner, Theodore Ts'o, fstests,
	linux-xfs

Depending on filesystem, copying from active swapfile may be allowed,
just as read from swapfile may be allowed.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Eryu,

Following feedback by Ted, I've decided it would be better to
remove the test case of copy from swap file.
There is no reason to deny that copy, but there is also no reason
for us to assert that filesystems must allow this functionality.

Even after removing the copy from test case, test still fails
on upstream for all filesystems I tested.
Tests passes with Darrick's copy-file-range-fixes branch.

Thanks,
Amir.

 tests/generic/554     | 3 +--
 tests/generic/554.out | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/generic/554 b/tests/generic/554
index 10ae4035..c946ca17 100755
--- a/tests/generic/554
+++ b/tests/generic/554
@@ -4,7 +4,7 @@
 #
 # FS QA Test No. 554
 #
-# Check that we cannot copy_file_range() to/from a swapfile
+# Check that we cannot copy_file_range() to a swapfile
 #
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
@@ -46,7 +46,6 @@ echo swap files return ETXTBUSY
 _format_swapfile $SCRATCH_MNT/swapfile 16m
 swapon $SCRATCH_MNT/swapfile
 $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
-$XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/swapfile" $SCRATCH_MNT/copy
 swapoff $SCRATCH_MNT/swapfile
 
 # success, all done
diff --git a/tests/generic/554.out b/tests/generic/554.out
index ffaa7b0a..19385a05 100644
--- a/tests/generic/554.out
+++ b/tests/generic/554.out
@@ -1,4 +1,3 @@
 QA output created by 554
 swap files return ETXTBUSY
 copy_range: Text file busy
-copy_range: Text file busy
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] generic/554: test only copy to active swap file
  2019-06-10 19:53 [PATCH] generic/554: test only copy to active swap file Amir Goldstein
@ 2019-06-11  3:19 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2019-06-11  3:19 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: Eryu Guan, Dave Chinner, Theodore Ts'o, fstests, linux-xfs

On Mon, Jun 10, 2019 at 10:53:17PM +0300, Amir Goldstein wrote:
> Depending on filesystem, copying from active swapfile may be allowed,
> just as read from swapfile may be allowed.
> 
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

LGTM,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
> 
> Eryu,
> 
> Following feedback by Ted, I've decided it would be better to
> remove the test case of copy from swap file.
> There is no reason to deny that copy, but there is also no reason
> for us to assert that filesystems must allow this functionality.
> 
> Even after removing the copy from test case, test still fails
> on upstream for all filesystems I tested.
> Tests passes with Darrick's copy-file-range-fixes branch.
> 
> Thanks,
> Amir.
> 
>  tests/generic/554     | 3 +--
>  tests/generic/554.out | 1 -
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/tests/generic/554 b/tests/generic/554
> index 10ae4035..c946ca17 100755
> --- a/tests/generic/554
> +++ b/tests/generic/554
> @@ -4,7 +4,7 @@
>  #
>  # FS QA Test No. 554
>  #
> -# Check that we cannot copy_file_range() to/from a swapfile
> +# Check that we cannot copy_file_range() to a swapfile
>  #
>  seq=`basename $0`
>  seqres=$RESULT_DIR/$seq
> @@ -46,7 +46,6 @@ echo swap files return ETXTBUSY
>  _format_swapfile $SCRATCH_MNT/swapfile 16m
>  swapon $SCRATCH_MNT/swapfile
>  $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
> -$XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/swapfile" $SCRATCH_MNT/copy
>  swapoff $SCRATCH_MNT/swapfile
>  
>  # success, all done
> diff --git a/tests/generic/554.out b/tests/generic/554.out
> index ffaa7b0a..19385a05 100644
> --- a/tests/generic/554.out
> +++ b/tests/generic/554.out
> @@ -1,4 +1,3 @@
>  QA output created by 554
>  swap files return ETXTBUSY
>  copy_range: Text file busy
> -copy_range: Text file busy
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-11  3:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-10 19:53 [PATCH] generic/554: test only copy to active swap file Amir Goldstein
2019-06-11  3:19 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox