Re: [PATCH v2 3/3] fs: use do_splice_direct() for nfsd/ksmbd server-side-copy

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

 



On Mon, Dec 4, 2023 at 10:39 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> On Thu, Nov 30, 2023 at 04:16:24PM +0200, Amir Goldstein wrote:
> > nfsd/ksmbd call vfs_copy_file_range() with flag COPY_FILE_SPLICE to
> > perform kernel copy between two files on any two filesystems.
> >
> > Splicing input file, while holding file_start_write() on the output file
> > which is on a different sb, posses a risk for fanotify related deadlocks.
> >
> > We only need to call splice_file_range() from within the context of
> > ->copy_file_range() filesystem methods with file_start_write() held.
> >
> > To avoid the possible deadlocks, always use do_splice_direct() instead of
> > splice_file_range() for the kernel copy fallback in vfs_copy_file_range()
> > without holding file_start_write().
>
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>
> (although I wish do_splice_direct had a better name like
> vfs_splice_direct, espcially before growing more users)

I tried very hard in this series to add a little bit of consistency
for function names and indication of what it may be responsible for.

After this cleanup series, many of the file permission hooks and
moved from do_XXX() helpers to vfs_XXX() helpers, so I cannot in
good conscience rename do_splice_direct(), which does not have
file permission hooks to vfs_splice_direct().

I can rename it to splice_direct() as several other splice_XXX()
exported helpers in this file.

ok?

Thanks,
Amir.





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

  Powered by Linux