Re: [PATCH] 2.6.13: POSIX violation in pipes on ia64 for kernels >2.6.10

From: Linus Torvalds
Date: Thu Oct 13 2005 - 14:55:04 EST




On Thu, 13 Oct 2005, Jeff Licquia wrote:
>
> On architectures where PAGE_SIZE > PIPE_BUF, a read of PIPE_BUF bytes
> from a full pipe does not change the pipe's write state. This behavior
> is different from kernels 2.6.9 and earlier, and it triggers failures of
> the LSB tests.

Sounds like the tests are broken.

It also sounds like your patch is broken: allowing partial short writes is
in explicit violation of the POSIX specs, and breaks the only thing that
PIPE_BUF _really_ guarantees, namely that writes smaller than that size
must be atomic.

The _only_ guarantees wrt PIPE_BUF is literally that a write smaller than
or equal to the PIPE_BUF will always either complete fully or not at all,
and that a reader will see the write as an atomic packet (ie two writers
will never have their write buffers interleaved within such a single
"write()" system call).

How empty the pipe has to be for a write to be able to do so is outside
the spec, and any code (including LSB tests) that depends on it is broken.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/