All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: He Zhe <zhe.he@windriver.com>, Dave Chinner <dchinner@redhat.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Luis Henriques <lhenriques@suse.com>,
	Olga Kornievskaia <kolga@netapp.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: warning for EOPNOTSUPP vfs_copy_file_range
Date: Fri, 20 May 2022 10:52:01 +0300	[thread overview]
Message-ID: <CAOQ4uxj+YSbywkKC8c6qRW55Ujcwxcjkf9sFg=e8m0xp8JLq9g@mail.gmail.com> (raw)
In-Reply-To: <CAOQ4uxizvWk-=JW=s-WXw0OGR3Wjm2YYkpwQqXHc27U=iRtQDg@mail.gmail.com>

On Fri, May 20, 2022 at 7:39 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Fri, May 20, 2022 at 6:56 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > On Thu, May 19, 2022 at 04:53:15PM +0300, Amir Goldstein wrote:
> >
> > > Luis gave up on it, because no maintainer stepped up to take
> > > the patch, but I think that is the right way to go.
> > >
> > > Maybe this bug report can raise awareness to that old patch.
> > >
> > > Al, could you have a look?
> >
> > IIRC, you had objections to that variant back then...
>
> Right. But not about the "main" patch.
> The patch had an "also" part:
>
> The short-circuit code for the case where the copy length is zero has also
> been dropped from the VFS code.  This is because a zero size copy between
> two files shall provide a clear indication on whether or not the
> filesystem supports non-zero copies.
>
> -     if (len == 0)
> -         return 0;
> -
>
> Which would have been a regression for nfs client, because
> nfs protocol treats length 0 from ->copy_file_range() as "copy everything":
>
> https://lore.kernel.org/linux-fsdevel/CAOQ4uxgwcNwWEqYKBg3fMHD3aXOsYUmPeexBe9EVP9Nb53b-Hw@mail.gmail.com/
>
> This api impedance should be fixed in the nfs client, but I'm
> not sure if that was already done.
>
> I will test and re-post Luis' patch without removing the short-circuit
> unless Luis gets to it first.
>

Urgh! That old patch passes the fstests -g copy_range group
on nfs, but fails almost all of them on xfs/btrfs.

The reason is that when we allow to perform copy_range
with remap_file_range() it fails for sizes smaller than block size
and returning short read of 0 from copy_range is not an option.

So what I am going to do is to keep the basic restriction in this patch of:
"copy_range allowed for fs that implement either ->copy_file_range()
or ->remap_file_range() (for same sb copy)"

But will change the logic of:
"try clone and then copy then fail"
to:
- try ->copy_file_range()
- try ->remap_file_range()
- fall back to kernel copy

Patch coming shortly.

Thanks,
Amir.

      reply	other threads:[~2022-05-20  7:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  8:22 warning for EOPNOTSUPP vfs_copy_file_range He Zhe
2022-05-19 13:53 ` Amir Goldstein
2022-05-19 14:31   ` Luís Henriques
2022-05-20  3:03     ` He Zhe
2022-05-20  4:42       ` Amir Goldstein
2022-05-20  3:16     ` Paul Gortmaker
2022-05-20  3:56   ` Al Viro
2022-05-20  4:39     ` Amir Goldstein
2022-05-20  7:52       ` Amir Goldstein [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='CAOQ4uxj+YSbywkKC8c6qRW55Ujcwxcjkf9sFg=e8m0xp8JLq9g@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=dchinner@redhat.com \
    --cc=kolga@netapp.com \
    --cc=lhenriques@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zhe.he@windriver.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.