All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: "Darrick J . Wong" <darrick.wong@oracle.com>,
	Dave Chinner <david@fromorbit.com>,
	Olga Kornievskaia <olga.kornievskaia@gmail.com>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: [PATCH v3 4/6] common/rc: check support for xfs_io copy_range -f N
Date: Sun,  2 Jun 2019 15:41:12 +0300	[thread overview]
Message-ID: <20190602124114.26810-5-amir73il@gmail.com> (raw)
In-Reply-To: <20190602124114.26810-1-amir73il@gmail.com>

Implement "_require_xfs_io_command copy_range -f" to check for
the option added by following xfsprogs commit:

  xfs_io: allow passing an open file to copy_range

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 common/rc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index 17b89d5d..0d26b0fc 100644
--- a/common/rc
+++ b/common/rc
@@ -2086,9 +2086,16 @@ _require_xfs_io_command()
 		;;
 	"copy_range")
 		local testcopy=$TEST_DIR/$$.copy.xfs_io
+		local copy_opts=$testfile
+		if [ "$param" == "-f" ]; then
+			# source file is the open destination file
+			testcopy=$testfile
+			copy_opts="0 -d 4k"
+		fi
 		$XFS_IO_PROG -F -f -c "pwrite 0 4k" $testfile > /dev/null 2>&1
-		testio=`$XFS_IO_PROG -F -f -c "copy_range $testfile" $testcopy 2>&1`
+		testio=`$XFS_IO_PROG -F -f -c "copy_range $param $copy_opts" $testcopy 2>&1`
 		rm -f $testcopy > /dev/null 2>&1
+		param_checked=1
 		;;
 	"falloc" )
 		testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`
-- 
2.17.1

  parent reply	other threads:[~2019-06-02 12:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02 12:41 [PATCH v3 0/6] fstests: copy_file_range() tests Amir Goldstein
2019-06-02 12:41 ` [PATCH v3 1/6] generic: create copy_range group Amir Goldstein
2019-06-02 12:41 ` [PATCH v3 2/6] generic: copy_file_range immutable file test Amir Goldstein
2019-06-07 17:10   ` Eryu Guan
2019-06-02 12:41 ` [PATCH v3 3/6] generic: copy_file_range swapfile test Amir Goldstein
2019-06-10  3:58   ` Theodore Ts'o
2019-06-10  6:37     ` Amir Goldstein
2019-06-10  9:08       ` Amir Goldstein
2019-06-10 13:31       ` Theodore Ts'o
2019-06-10 16:06         ` Darrick J. Wong
2019-06-10 16:54           ` Amir Goldstein
2019-06-10 17:04             ` Darrick J. Wong
2019-06-11  2:13           ` Eryu Guan
2019-06-11  2:12         ` Eryu Guan
2019-06-11  2:36           ` Eryu Guan
2019-06-02 12:41 ` Amir Goldstein [this message]
2019-06-02 12:41 ` [PATCH v3 5/6] generic: copy_file_range bounds test Amir Goldstein
2019-06-02 12:41 ` [PATCH v3 6/6] generic: cross-device copy_file_range test Amir Goldstein
2019-06-09 13:46 ` [PATCH v3 0/6] fstests: copy_file_range() tests Eryu Guan

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=20190602124114.26810-5-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=olga.kornievskaia@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.