[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bd92932-c9d2-4cc8-b730-24c749087e39@mattwhitlock.name>
Date: Thu, 29 Jun 2023 14:05:16 -0400
From: Matt Whitlock <kernel@...twhitlock.name>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Howells <dhowells@...hat.com>, <netdev@...r.kernel.org>,
Matthew Wilcox <willy@...radead.org>,
Dave Chinner <david@...morbit.com>,
Jens Axboe <axboe@...nel.dk>, <linux-fsdevel@...ck.org>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 0/4] splice: Fix corruption in data spliced to pipe
On Thursday, 29 June 2023 13:56:04 EDT, Linus Torvalds wrote:
> On Thu, 29 Jun 2023 at 08:55, David Howells <dhowells@...hat.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.
Powered by blists - more mailing lists