Re: [RFC PATCH 1/4] splice: Fix corruption of spliced data after splice() returns

From: Miklos Szeredi
Date: Mon Jul 24 2023 - 09:56:43 EST


On Mon, 24 Jul 2023 at 11:44, David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > > So what's the API that provides the semantics of _copying_?
> >
> > It's called "read()" and "write()".
>
> What about copy_file_range()? That seems to fall back to splicing if not
> directly implemented by the filesystem. It looks like the manpage for that
> needs updating too - or should that actually copy?

Both source and destination of copy_file_range() are regular files and
do_splice_direct() is basically equivalent to write(dest, mmap of
source), no refd buffers remain beyond the end of the syscall. What
is it that should be updated in the manpage?

Thanks,
Miklos