All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: Luis Henriques <lhenriques@suse.com>
Cc: fstests@vger.kernel.org, Anna Schumaker <Anna.Schumaker@Netapp.com>
Subject: Re: [PATCH 2/2] common/rc: handle xfs_io copy_range when copy_file_range syscall isn't available
Date: Tue, 27 Jun 2017 13:25:29 +0800	[thread overview]
Message-ID: <20170627052529.GX23360@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20170626164053.7634-2-lhenriques@suse.com>

On Mon, Jun 26, 2017 at 05:40:53PM +0100, Luis Henriques wrote:
> _require_xfs_io_command() isn't handling the case where the copy_file_range
> syscall isn't available.  Unfortunately, old versions of xfs_io don't
> handle it correctly either and the test will succeed with an empty file.

If copy_file_range syscall isn't available on the system, xfs_io should
have no "copy_range" built either, or if you're using a pre-built xfs_io
binary shipped by a distro, it should have no copy_range either to match
the kernel space. Anyway, I don't think it would cause any problem if
there's no copy_file_range syscall support. I'm curious what's your
environment setup.

> 
> To fix this function, we need to add two checks:
> 
> 1) for old xfs_io versions, fail if the test seems to succeed (no output)
>    but the file created is empty,
> 2) for newer versions, use the error returned.
> 
> Signed-off-by: Luis Henriques <lhenriques@suse.com>
> ---
>  common/rc | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 2972f89e9527..aad065cb2ade 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2146,6 +2146,10 @@ _require_xfs_io_command()
>  		$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`
>  		rm -f $testcopy > /dev/null 2>&1

$testcopy is removed here...

> +		[ -z "$testio" -a ! -s "$testcopy" ] && \

then on hosts with copy_file_range support, this check always returns
true, and test _notrun when it should run.

Thanks,
Eryu

> +			_notrun "xfs_io $command support is missing"
> +		echo $testio | egrep -q "Function not implemented" && \
> +			_notrun "xfs_io $command support is missing"
>  		;;
>  	"falloc" )
>  		testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-06-27  5:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 16:40 [PATCH 1/2] generic/430: Fix filename in "copy beyond end" test Luis Henriques
2017-06-26 16:40 ` [PATCH 2/2] common/rc: handle xfs_io copy_range when copy_file_range syscall isn't available Luis Henriques
2017-06-27  5:25   ` Eryu Guan [this message]
2017-06-27  8:50     ` Luis Henriques
2017-06-28  7:50       ` Eryu Guan
2017-06-28 11:20         ` [PATCH 2/2 v2] " Luis Henriques
2017-06-28 14:21 ` [PATCH 1/2] generic/430: Fix filename in "copy beyond end" test David Disseldorp

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=20170627052529.GX23360@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=fstests@vger.kernel.org \
    --cc=lhenriques@suse.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.