public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: liuhuan01@kylinos.cn
Cc: dchinner@redhat.com, linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] xfs: use FICLONE/FICLONERANGE/FIDEDUPERANGE for test cases
Date: Wed, 21 Aug 2024 10:14:49 -0700	[thread overview]
Message-ID: <20240821171449.GJ6047@frogsfrogsfrogs> (raw)
In-Reply-To: <20240817065027.14459-1-liuhuan01@kylinos.cn>

On Sat, Aug 17, 2024 at 02:50:27PM +0800, liuhuan01@kylinos.cn wrote:
> From: liuh <liuhuan01@kylinos.cn>
> 
> With the patch "xfs_io: use FICLONE/FICLONERANGE/FIDEDUPERANGE for reflink/dedupe IO commands", and modify relevant test cases.
> 
> Signed-off-by: liuh <liuhuan01@kylinos.cn>
> ---
>  common/reflink        |  2 +-
>  tests/generic/122.out |  2 +-
>  tests/generic/136.out |  2 +-
>  tests/generic/157.out | 18 +++++++++---------
>  tests/generic/158.out | 20 ++++++++++----------
>  tests/generic/303.out |  8 ++++----
>  tests/generic/304.out | 14 +++++++-------
>  tests/generic/493.out |  4 ++--
>  tests/generic/516.out |  2 +-
>  tests/generic/518.out |  2 +-
>  tests/xfs/319.out     |  2 +-
>  tests/xfs/321.out     |  2 +-
>  tests/xfs/322.out     |  2 +-
>  tests/xfs/323.out     |  2 +-
>  14 files changed, 41 insertions(+), 41 deletions(-)
> 
> diff --git a/common/reflink b/common/reflink
> index 22adc444..21df20e2 100644
> --- a/common/reflink
> +++ b/common/reflink
> @@ -261,7 +261,7 @@ _dedupe_range() {
>  # Unify xfs_io dedupe ioctl error message prefix
>  _filter_dedupe_error()
>  {
> -	sed -e 's/^dedupe:/XFS_IOC_FILE_EXTENT_SAME:/g'
> +	sed -e 's/^dedupe:/FIDEDUPERANGE:/g'

Hmm, don't you have to squash both "dedupe:" and
"XFS_IOC_FILE_EXTENT_SAME:" to "FIDEDUPERANGE:" here?  Or else you break
the intermediate xfs_io versions that emit "XFS_IOC_FILE_EXTENT_SAME:"?

And apply the same filtering for the clone and clonerange ioctls?

(Or just leave the error message prefixes in xfs_io the way they are!)

--D

>  }
>  
>  # Create a file of interleaved unwritten and reflinked blocks
> diff --git a/tests/generic/122.out b/tests/generic/122.out
> index 4459985c..f243d153 100644
> --- a/tests/generic/122.out
> +++ b/tests/generic/122.out
> @@ -4,7 +4,7 @@ Create the original files
>  5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-122/file2
>  Files 1-2 do not match (intentional)
>  (Fail to) dedupe the middle blocks together
> -XFS_IOC_FILE_EXTENT_SAME: Extents did not match.
> +FIDEDUPERANGE: Extents did not match.
>  Compare sections
>  35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-122/file1
>  5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-122/file2
> diff --git a/tests/generic/136.out b/tests/generic/136.out
> index 508953f6..eee44f07 100644
> --- a/tests/generic/136.out
> +++ b/tests/generic/136.out
> @@ -7,7 +7,7 @@ c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file2
>  Dedupe the last blocks together
>  1->2
>  1->3
> -XFS_IOC_FILE_EXTENT_SAME: Extents did not match.
> +FIDEDUPERANGE: Extents did not match.
>  c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file1
>  c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file2
>  07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-136/file3
> diff --git a/tests/generic/157.out b/tests/generic/157.out
> index d4f64b44..0ef12f80 100644
> --- a/tests/generic/157.out
> +++ b/tests/generic/157.out
> @@ -2,23 +2,23 @@ QA output created by 157
>  Format and mount
>  Create the original files
>  Try cross-device reflink
> -XFS_IOC_CLONE_RANGE: Invalid cross-device link
> +FICLONERANGE: Invalid cross-device link
>  Try unaligned reflink
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try overlapping reflink
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try reflink past EOF
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try to reflink a dir
> -XFS_IOC_CLONE_RANGE: Is a directory
> +FICLONERANGE: Is a directory
>  Try to reflink a device
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try to reflink to a dir
>  TEST_DIR/test-157/dir1: Is a directory
>  Try to reflink to a device
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try to reflink to a fifo
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Try to reflink an append-only file
> -XFS_IOC_CLONE_RANGE: Bad file descriptor
> +FICLONERANGE: Bad file descriptor
>  Reflink two files
> diff --git a/tests/generic/158.out b/tests/generic/158.out
> index 8df9d9a5..2b304820 100644
> --- a/tests/generic/158.out
> +++ b/tests/generic/158.out
> @@ -2,26 +2,26 @@ QA output created by 158
>  Format and mount
>  Create the original files
>  Try cross-device dedupe
> -XFS_IOC_FILE_EXTENT_SAME: Invalid cross-device link
> +FIDEDUPERANGE: Invalid cross-device link
>  Try unaligned dedupe
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try overlapping dedupe
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try dedupe from past EOF
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try dedupe to past EOF, destination offset beyond EOF
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try dedupe to past EOF, destination offset behind EOF
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try to dedupe a dir
> -XFS_IOC_FILE_EXTENT_SAME: Is a directory
> +FIDEDUPERANGE: Is a directory
>  Try to dedupe a device
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try to dedupe to a dir
>  TEST_DIR/test-158/dir1: Is a directory
>  Try to dedupe to a device
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try to dedupe to a fifo
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Try to dedupe an append-only file
>  Dedupe two files
> diff --git a/tests/generic/303.out b/tests/generic/303.out
> index 39a88038..256ef66f 100644
> --- a/tests/generic/303.out
> +++ b/tests/generic/303.out
> @@ -4,14 +4,14 @@ Create the original files
>  Reflink large single byte file
>  Reflink large empty file
>  Reflink past maximum file size in dest file (should fail)
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Reflink high offset to low offset
>  Reflink past source file EOF (should fail)
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Reflink max size at nonzero offset (should fail)
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Reflink with huge off/len (should fail)
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  Check file creation
>  file3
>  7ffffffffffffffe:  61  a
> diff --git a/tests/generic/304.out b/tests/generic/304.out
> index a979099b..d43dd70c 100644
> --- a/tests/generic/304.out
> +++ b/tests/generic/304.out
> @@ -2,19 +2,19 @@ QA output created by 304
>  Format and mount
>  Create the original files
>  Dedupe large single byte file
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe large empty file
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe past maximum file size in dest file (should fail)
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe high offset to low offset
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe past source file EOF (should fail)
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe max size at nonzero offset (should fail)
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Dedupe with huge off/len (should fail)
> -XFS_IOC_FILE_EXTENT_SAME: Invalid argument
> +FIDEDUPERANGE: Invalid argument
>  Check file creation
>  file3
>  7ffffffffffffffe:  61  a
> diff --git a/tests/generic/493.out b/tests/generic/493.out
> index d3426ee6..8bb71d3b 100644
> --- a/tests/generic/493.out
> +++ b/tests/generic/493.out
> @@ -2,6 +2,6 @@ QA output created by 493
>  Format and mount
>  Initialize file
>  Try to dedupe
> -XFS_IOC_FILE_EXTENT_SAME: Text file busy
> -XFS_IOC_FILE_EXTENT_SAME: Text file busy
> +FIDEDUPERANGE: Text file busy
> +FIDEDUPERANGE: Text file busy
>  Tear it down
> diff --git a/tests/generic/516.out b/tests/generic/516.out
> index 90308c49..53611b3b 100644
> --- a/tests/generic/516.out
> +++ b/tests/generic/516.out
> @@ -4,7 +4,7 @@ Create the original files
>  39578c21e2cb9f6049b1cf7fc7be12a6  TEST_DIR/test-516/file2
>  Files 1-2 do not match (intentional)
>  (partial) dedupe the middle blocks together
> -XFS_IOC_FILE_EXTENT_SAME: Extents did not match.
> +FIDEDUPERANGE: Extents did not match.
>  Compare sections
>  35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-516/file1
>  39578c21e2cb9f6049b1cf7fc7be12a6  TEST_DIR/test-516/file2
> diff --git a/tests/generic/518.out b/tests/generic/518.out
> index 726c2073..57ae9155 100644
> --- a/tests/generic/518.out
> +++ b/tests/generic/518.out
> @@ -3,7 +3,7 @@ wrote 262244/262244 bytes at offset 0
>  XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  wrote 1048576/1048576 bytes at offset 0
>  XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -XFS_IOC_CLONE_RANGE: Invalid argument
> +FICLONERANGE: Invalid argument
>  File content after failed reflink:
>  0000000 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5
>  *
> diff --git a/tests/xfs/319.out b/tests/xfs/319.out
> index 160f5fd2..25f1ed2e 100644
> --- a/tests/xfs/319.out
> +++ b/tests/xfs/319.out
> @@ -7,7 +7,7 @@ Check files
>  4155b81ac6d45c0182fa2bc03960f230  SCRATCH_MNT/file3
>  Inject error
>  Try to reflink
> -XFS_IOC_CLONE_RANGE: Input/output error
> +FICLONERANGE: Input/output error
>  FS should be shut down, touch will fail
>  touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
>  Remount to replay log
> diff --git a/tests/xfs/321.out b/tests/xfs/321.out
> index c0abd52b..59fd7b7b 100644
> --- a/tests/xfs/321.out
> +++ b/tests/xfs/321.out
> @@ -6,7 +6,7 @@ Check files
>  b5cfa9d6c8febd618f91ac2843d50a1c  SCRATCH_MNT/file3
>  Inject error
>  Try to reflink
> -XFS_IOC_CLONE_RANGE: Input/output error
> +FICLONERANGE: Input/output error
>  FS should be shut down, touch will fail
>  touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
>  Remount to replay log
> diff --git a/tests/xfs/322.out b/tests/xfs/322.out
> index b3fba5d0..695dd48b 100644
> --- a/tests/xfs/322.out
> +++ b/tests/xfs/322.out
> @@ -6,7 +6,7 @@ Check files
>  b5cfa9d6c8febd618f91ac2843d50a1c  SCRATCH_MNT/file3
>  Inject error
>  Try to reflink
> -XFS_IOC_CLONE_RANGE: Input/output error
> +FICLONERANGE: Input/output error
>  FS should be shut down, touch will fail
>  touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
>  Remount to replay log
> diff --git a/tests/xfs/323.out b/tests/xfs/323.out
> index 99b9688c..f7f36c05 100644
> --- a/tests/xfs/323.out
> +++ b/tests/xfs/323.out
> @@ -6,7 +6,7 @@ Check files
>  4155b81ac6d45c0182fa2bc03960f230  SCRATCH_MNT/file3
>  Inject error
>  Try to reflink
> -XFS_IOC_CLONE_RANGE: Input/output error
> +FICLONERANGE: Input/output error
>  FS should be shut down, touch will fail
>  touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
>  Remount to replay log
> -- 
> 2.43.0
> 
> 

      reply	other threads:[~2024-08-21 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09  9:02 [PATCH] xfs_io: use FICLONE/FICLONERANGE/FIDEDUPERANGE for reflink/dudupe IO commands liuhuan01
2024-08-09 15:04 ` Darrick J. Wong
2024-08-17  6:48   ` [PATCH] xfs_io: use FICLONE/FICLONERANGE/FIDEDUPERANGE for reflink/dedupe " liuhuan01
2024-08-17  6:50   ` [PATCH] xfs: use FICLONE/FICLONERANGE/FIDEDUPERANGE for test cases liuhuan01
2024-08-21 17:14     ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240821171449.GJ6047@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=liuhuan01@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox