Re: [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range

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

 



On Fri, Nov 30, 2018 at 10:42 PM Darrick J. Wong
<darrick.wong@xxxxxxxxxx> wrote:
>
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
>
> In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the
> lower filesystem's inode, passing through whatever remap flags it got
> from its caller.  Since vfs_copy_file_range first tries a filesystem's
> remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through
> to the second vfs_copy_file_range call, which isn't an issue.
> Remove the WARN_ON because it's unnecessary.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  fs/read_write.c |    2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 4dae0399c75a..2d9fed57e7dd 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1956,8 +1956,6 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
>         struct inode *inode_out = file_inode(file_out);
>         loff_t ret;
>
> -       WARN_ON_ONCE(remap_flags);
> -

WARN_ON_ONCE(remap_flags & ~REMAP_FILE_ADVISORY);

We still do not want anyone to call do_clone_file_range(..., REMAP_FILE_DEDUP)

If we had more users of the overloaded interface, we need to do:

WARN_ON_ONCE((remap_flags & REMAP_FILE_OP_MASK) == REMAP_FILE_OP_CLONE);

With the minor fix, you can add:
Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>

Thanks,
Amir.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux