Re: [PATCH v5 02/12] VFS: generic cross-device copy_file_range() support for all filesystems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 29, 2018 at 7:41 PM Olga Kornievskaia
<olga.kornievskaia@xxxxxxxxx> wrote:
>
> From: Olga Kornievskaia <kolga@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> ---
>  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
>



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux