Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern

On Tue, Dec 15, 2009 at 06:35:18PM +0000, David Laight wrote:
 > Modified Files:
 >      src/sys/kern: sys_pipe.c
 > Log Message:
 > Don't ERESTART write() calls for now.
 > I suspect some programs don't allow for the partial transfer.

More likely, the pipe is stuttering and repeating itself. Once data's
been transferred, you *have* to succeed and return the amount
transferred; otherwise anything that tries again (whether the
application or transparently by syscall restart) is going to send the
same data over again.

The application then still might not handle short writes correctly,
but at least it gets a chance to try.

There's no logic in pipe_write for handling this at all, and the
EAGAIN case is broken too. And AFAICT pipe_read has the same problem.

And also, it looks like pipe_read doesn't necessarily service reads of
size PIPE_BUF-or-less atomically, which I'm pretty sure it's supposed
to, although I don't have the POSIX c&v on hand.

David A. Holland

Home | Main Index | Thread Index | Old Index