lkml.org 
[lkml]   [2023]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 0/4] splice: Fix corruption in data spliced to pipe
Date
On Thursday, 29 June 2023 13:56:04 EDT, Linus Torvalds wrote:
> On Thu, 29 Jun 2023 at 08:55, David Howells <dhowells@redhat.com> wrote:
>>
>> Matt Whitlock, Matthew Wilcox and Dave Chinner are of the
>> opinion that data
>> in the pipe must not be seen to change and that if it does, this is a bug.
>
> I'm not convinced.
>
> The whole *point* of vmsplice (and splicing from a file) is the zero-copy.
>
> If you don't want the zero-copy, then you should use just "write()".

If you want zero copies, then call splice() *with* SPLICE_F_MOVE.

If you want one copy (kernel-to-kernel), then call splice() *without*
SPLICE_F_MOVE.

If you want two copies (kernel-to-user + user-to-kernel), call read() and
write().

I don't know why SPLICE_F_MOVE is being ignored in this thread. Sure, maybe
the way it has historically been implemented was only relevant when the
input FD is a pipe, but that's not what the man page implies. You have the
opportunity to make it actually do what it says on the tin.

\
 
 \ /
  Last update: 2023-06-29 20:08    [W:0.152 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site