RE: [PATCH] pipe: Make a partially-satisfied blocking read wait for more

From: David Laight
Date: Mon Jun 26 2023 - 05:32:01 EST


From: Linus Torvalds
> Sent: 23 June 2023 23:42
>
> On Fri, 23 Jun 2023 at 15:34, David Howells <dhowells@xxxxxxxxxx> wrote:
> >
> > Can you consider merging something like the attached patch? Unfortunately,
> > there are applications out there that depend on a read from pipe() waiting
> > until the buffer is full under some circumstances. Patch a28c8b9db8a1
> > removed the conditionality on there being an attached writer.
>
> This patch seems actively wrong, in that now it's possibly waiting for
> data that won't come, even if it's nonblocking.

I think it pretty much breaks:
command | tee file
where 'command' is careful to fflush(stdout).

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)