[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wg-9vyvbQPy_Aa=BQmkdX7b=ANinNUU+22tMELuxmH99g@mail.gmail.com>
Date: Fri, 2 Jun 2023 12:36:34 -0400
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Howells <dhowells@...hat.com>
Cc: netdev@...r.kernel.org, Chuck Lever <chuck.lever@...cle.com>,
Boris Pismenny <borisp@...dia.com>, John Fastabend <john.fastabend@...il.com>,
Jakub Kicinski <kuba@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>, David Ahern <dsahern@...nel.org>,
Matthew Wilcox <willy@...radead.org>, Jens Axboe <axboe@...nel.dk>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Al Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, Jeff Layton <jlayton@...nel.org>,
David Hildenbrand <david@...hat.com>, Christian Brauner <brauner@...nel.org>, linux-fsdevel@...r.kernel.org,
linux-block@...r.kernel.org
Subject: Re: [PATCH net-next v3 05/11] splice, net: Fix SPLICE_F_MORE
signalling in splice_direct_to_actor()
On Fri, Jun 2, 2023 at 11:08 AM David Howells <dhowells@...hat.com> wrote:
>
> Fix this by making splice_direct_to_actor() always signal SPLICE_F_MORE if
> we haven't yet hit the requested operation size.
Well, I certainly like this patch better than the previous versions,
just because it doesn't add random fd-specific code.
That said, I think it might be worth really documenting the behavior,
particularly for files where the kernel *could* know "the file is at
EOF, no more data".
I hope that if user space wants to splice() a file to a socket, said
user space would have done an 'fstat()' and actually pass in the file
size as the length to splice(). Because if they do, I think this
simplified patch does the right thing automatically.
But if user space instead passes in a "maximally big len", and just
depends on the kernel then doing tha
ret = do_splice_to(in, &pos, pipe, len, flags);
if (unlikely(ret <= 0))
goto out_release;
to stop splicing at EOF, then the last splice_write() will have had
SPLICE_F_MORE set, even though no more data is coming from the file,
of course.
And I think that's fine. But wasn't that effectively what the old code
was already doing because 'read_len' was smaller than 'len'? I thought
that was what you wanted to fix?
IOW, I thought you wanted to clear SPLICE_F_MORE when we hit EOF. This
still doesn't do that.
So now I'm confused about what your "fix" is. Your patch doesn't
actually seem to change existing behavior in splice_direct_to_actor().
I was expecting you to actually pass the 'sd' down to do_splice_to()
and then to ->splice_read(), so that the splice_read() function could
say "I have no more", and clear it.
But you didn't do that.
Am I misreading something, or did I miss another patch?
Linus
Powered by blists - more mailing lists