Message ID | 20181029174059.38326-4-olga.kornievskaia@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | client-side support for "inter" SSC copy | expand |
On Mon, Oct 29, 2018 at 01:40:49PM -0400, Olga Kornievskaia wrote: > From: Olga Kornievskaia <kolga@netapp.com> > > If a filesystem does not support cross device or cross file system > type copy offload functionality, then this patch provides a fallback > to a page cache based physical data copy. This means the > copy_file_range() systemcall will never fail with EXDEV, and so in > future userspace will not need to detect or provide a fallback for > failed cross-device copies anymore. > > Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Reviewed-by: Matthew Wilcox <willy@infradead.org>
On Mon, Oct 29, 2018 at 7:41 PM Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote: > > From: Olga Kornievskaia <kolga@netapp.com> > > If a filesystem does not support cross device or cross file system > type copy offload functionality, then this patch provides a fallback The flaw in this statement is that in the common case, filesystem that does not support copy_file_range, doesn't have copy_file_range() file operation, so in fact, patch [1/12] has already implemented "generic cross-device copy_file_range() support for most filesystems" This is why the order of this patch in the series is awkward. Please see my suggestion in comment to patch [1/12]. > to a page cache based physical data copy. This means the > copy_file_range() systemcall will never fail with EXDEV, and so in > future userspace will not need to detect or provide a fallback for > failed cross-device copies anymore. > > Signed-off-by: Olga Kornievskaia <kolga@netapp.com> > --- > fs/read_write.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/read_write.c b/fs/read_write.c > index 7a912e3..cff59bd 100644 > --- a/fs/read_write.c > +++ b/fs/read_write.c > @@ -1597,7 +1597,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, > if (file_out->f_op->copy_file_range) { > ret = file_out->f_op->copy_file_range(file_in, pos_in, file_out, > pos_out, len, flags); > - if (ret != -EOPNOTSUPP) > + if (ret != -EOPNOTSUPP && ret != -EXDEV) > goto done; > } > > -- > 1.8.3.1 >
diff --git a/fs/read_write.c b/fs/read_write.c index 7a912e3..cff59bd 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1597,7 +1597,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, if (file_out->f_op->copy_file_range) { ret = file_out->f_op->copy_file_range(file_in, pos_in, file_out, pos_out, len, flags); - if (ret != -EOPNOTSUPP) + if (ret != -EOPNOTSUPP && ret != -EXDEV) goto done; }