From: Dave Chinner <david@fromorbit.com>
To: Anna Schumaker <Anna.Schumaker@Netapp.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs_io: Improvements to copy_range return code handling
Date: Fri, 9 Dec 2016 10:15:15 +1100 [thread overview]
Message-ID: <20161208231514.GM4219@dastard> (raw)
In-Reply-To: <20161208184447.23020-1-Anna.Schumaker@Netapp.com>
On Thu, Dec 08, 2016 at 01:44:47PM -0500, Anna Schumaker wrote:
> If copy_file_range() returns 0, then that means no data was copied. We
> should break out of the loop in this case to prevent looping
> indefinitely.
>
> Additionally, if an error is returned by copy_file_range() then we need
> to print out the string form to be used by error checking tests in
> xfstests.
>
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> ---
> io/copy_file_range.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/io/copy_file_range.c b/io/copy_file_range.c
> index eddc634..161bdcf 100644
> --- a/io/copy_file_range.c
> +++ b/io/copy_file_range.c
> @@ -49,8 +49,11 @@ copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
>
> do {
> ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst, len, 0);
> - if (ret == -1)
> + if (ret == -1) {
> + fprintf(stderr, _("copy_range: %s\n"), strerror(errno));
perror("copy_range")?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2016-12-08 23:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-08 18:44 [PATCH] xfs_io: Improvements to copy_range return code handling Anna Schumaker
2016-12-08 23:15 ` Dave Chinner [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=20161208231514.GM4219@dastard \
--to=david@fromorbit.com \
--cc=Anna.Schumaker@Netapp.com \
--cc=linux-xfs@vger.kernel.org \
/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