All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH] generic/564: fix copy_range -f availability test
Date: Fri, 13 Sep 2019 13:51:40 -0400	[thread overview]
Message-ID: <20190913175140.GE28512@bfoster> (raw)
In-Reply-To: <5003d229-a168-a7bb-96b7-db4eb096806b@redhat.com>

On Thu, Sep 12, 2019 at 11:15:49AM -0500, Eric Sandeen wrote:
> generic/564 wants to test for copy_range -f, but as it's implemented
> it calls copy_range with a length of zero which will silently return
> success from the VFS (at least on some kernels) even if the underlying
> fs doesn't support it.
> 
> So patch this up 2 ways; perform the test with an explicit length
> so it's not a no-op, and go ahead test copy_range w/o -f in the test
> first just to be on the safe side (and for clearer failure messages.)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 

Reviewed-by: Brian Foster <bfoster@redhat.com>

> diff --git a/common/rc b/common/rc
> index e0b087c1..66c7fd4d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2109,7 +2109,7 @@ _require_xfs_io_command()
>  		if [ "$param" == "-f" ]; then
>  			# source file is the open destination file
>  			testcopy=$testfile
> -			copy_opts="0 -d 4k"
> +			copy_opts="0 -d 4k -l 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 $param $copy_opts" $testcopy 2>&1`
> diff --git a/tests/generic/564 b/tests/generic/564
> index ee1786cc..4958b3b5 100755
> --- a/tests/generic/564
> +++ b/tests/generic/564
> @@ -49,6 +49,8 @@ _require_loop
>  # copy source, as an indication that the test can run without hanging
>  # with large size argument and to avoid opening pipe in blocking mode.
>  #
> +# Test both basic copy_range and copy_range -f availability
> +_require_xfs_io_command "copy_range"
>  _require_xfs_io_command "copy_range" "-f"
>  
>  testdir="$TEST_DIR/test-$seq"
> 

      reply	other threads:[~2019-09-13 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 16:15 [PATCH] generic/564: fix copy_range -f availability test Eric Sandeen
2019-09-13 17:51 ` Brian Foster [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=20190913175140.GE28512@bfoster \
    --to=bfoster@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=sandeen@redhat.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.