All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Matthew Wilcox <willy@infradead.org>,
	Olga Kornievskaia <olga.kornievskaia@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
	linux-nfs <linux-nfs@vger.kernel.org>,
	fweimer@redhat.com, Steve French <smfrench@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH v1 02/11] VFS permit cross device vfs_copy_file_range
Date: Sun, 21 Oct 2018 09:01:31 -0400	[thread overview]
Message-ID: <ebb0346420183190d565a9c5bb34c2accc500133.camel@kernel.org> (raw)
In-Reply-To: <20181019190630.GC28891@bombadil.infradead.org>

On Fri, 2018-10-19 at 12:06 -0700, Matthew Wilcox wrote:
> On Fri, Oct 19, 2018 at 02:47:42PM -0400, Olga Kornievskaia wrote:
> > On Fri, Oct 19, 2018 at 1:58 PM Matthew Wilcox <willy@infradead.org> wrote:
> > > 
> > > On Fri, Oct 19, 2018 at 11:30:18AM -0400, Olga Kornievskaia wrote:
> > > > +++ b/Documentation/filesystems/vfs.txt
> > > > @@ -958,7 +958,9 @@ otherwise noted.
> > > > 
> > > >    fallocate: called by the VFS to preallocate blocks or punch a hole.
> > > > 
> > > > -  copy_file_range: called by the copy_file_range(2) system call.
> > > > +  copy_file_range: called by copy_file_range(2) system call. This method
> > > > +                works on two file descriptors that might reside on
> > > > +                different superblocks of the same type of file system.
> > > 
> > > I don't think this text is explicit enough about what has changed,
> > 
> > Can you suggest a different wording that would be stronger? I can't
> > say any more clear that copy is allowed between different superblock
> > which wasn't the case before.
> 
> I would leave this file alone.
> 
> > > and I
> > > think this is the wrong place for it.  I think there should be a paragraph
> > > in Documentation/filesystems/porting and it should follow the current style
> > > in there.
> > 
> > I have looked at the "porting" file and it's cryptic. I don't
> > understand what [mandatory] [recommended] stanzas are. There is
> > currently no copy_file_range. Is this just a "changelog" and you are
> > looking for something like
> > [mandatory]
> > copy_file_range() now allows copying between different superblocks.
> > 
> > I can add this wording to the "porting" file.
> 
> The porting file is written from the point of view of someone who's trying
> to port an old filesystem to current Linux.
> 
> Maybe something like
> 
> [mandatory]
> 	->copy_file_range() may now be passed files which belong to two
> 	different filesystems.  The destination's copy_file_range() is the
> 	function which is called.  If it cannot copy ranges from the source,
> 	it should return -EXDEV.
> 
> > > > -     if (file_out->f_op->copy_file_range) {
> > > > +     if (file_out->f_op->copy_file_range &&
> > > > +                     (file_in->f_op->copy_file_range ==
> > > > +                             file_out->f_op->copy_file_range)) {
> > > 
> > > Can we avoid this extra test here?  I know the various stamdards groups
> > > including T10 and the IETF have been trying to define a universal
> > > identifier for the same blob of storage, no matter how it's accessed;
> > > potentially allowing access to the same storage across iSCSI, CIFS
> > > and NFS.  If we ever get to a point where we support that (and I am
> > > dubious), we'd want to remove this test again, and have to revalidate
> > > all the filesystems.
> > 
> > Well from previous submissions I was explicitly asked to add this check.
> 
> I'm not sure that's exactly what Jeff was asking for.  Or maybe it was
> and my argument above will change his mind.  Jeff, what do you think?
> 
> If we do do this, cifs will need a modification as part of this patch to
> reject non-CIFS files as it currently assumes that src_file->private_data
> is a pointer to a struct cifsFileInfo.

My suggestion to Olga was more of a "if you feel you have to have a
check like this at the vfs layer...", but I think you and Al have
convinced me that comparing operations like this is not a good idea.

I still think that this check belongs down inside the fs copy_file_range
operation itself. That allows the the freedom to implement xdev copies
on a per-fs basis later without needing to alter vfs-level code.
-- 
Jeff Layton <jlayton@kernel.org>


  reply	other threads:[~2018-10-21 13:01 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 15:30 [PATCH v1 01/11] fs: Don't copy beyond the end of the file Olga Kornievskaia
2018-10-19 15:30 ` [PATCH v1 02/11] VFS permit cross device vfs_copy_file_range Olga Kornievskaia
2018-10-19 15:54   ` Amir Goldstein
2018-10-19 16:14     ` Amir Goldstein
2018-10-19 17:44       ` Matthew Wilcox
2018-10-19 17:58         ` Amir Goldstein
2018-10-19 16:24     ` Olga Kornievskaia
2018-10-19 17:04       ` Olga Kornievskaia
2018-10-20  1:37       ` Steve French
2018-10-19 17:58   ` Matthew Wilcox
2018-10-19 18:47     ` Olga Kornievskaia
2018-10-19 19:06       ` Matthew Wilcox
2018-10-21 13:01         ` Jeff Layton [this message]
2018-10-22 18:39         ` Olga Kornievskaia
2018-10-21 14:10     ` Jeff Layton
2018-10-20  4:05   ` Al Viro
2018-10-20  8:54     ` Amir Goldstein
2018-10-22 18:45       ` Olga Kornievskaia
2018-10-22 19:06         ` Matthew Wilcox
2018-10-22 19:34           ` Olga Kornievskaia
2018-10-22 19:48             ` Amir Goldstein
2018-10-22 20:29               ` Matthew Wilcox
2018-10-22 23:39             ` Jeff Layton
2018-10-23  6:05               ` Amir Goldstein
2018-10-23 15:03                 ` Olga Kornievskaia
2018-10-23 15:30                   ` Olga Kornievskaia
2018-10-23 17:16                     ` Olga Kornievskaia
2018-10-24 11:17                       ` Jeff Layton
2018-10-24 19:59                         ` Olga Kornievskaia
2018-10-25  4:58                           ` Amir Goldstein
2018-10-25 15:58                             ` Olga Kornievskaia
2018-10-25 16:00                               ` Olga Kornievskaia
2018-10-25 16:57                                 ` Amir Goldstein
2018-10-23 15:39                   ` Matthew Wilcox
2018-10-24 11:32                     ` Amir Goldstein
  -- strict thread matches above, loose matches on Subject: below --
2018-10-19 15:29 [PATCH v1 00/11] client-side support for "inter" SSC copy Olga Kornievskaia
2018-10-19 15:29 ` [PATCH v1 02/11] VFS permit cross device vfs_copy_file_range Olga Kornievskaia
2018-10-19 16:14   ` Trond Myklebust
2018-10-19 16:14     ` Trond Myklebust
2018-10-19 16:26     ` Olga Kornievskaia

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=ebb0346420183190d565a9c5bb34c2accc500133.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=fweimer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=olga.kornievskaia@gmail.com \
    --cc=smfrench@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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 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.