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.