splice: only return -EAGAIN if there's hope of more data
commit5794f1e90b2cecd56aff9d4e3f14cfe314eaf7e9
authorJens Axboe <jens.axboe@oracle.com>
Wed, 20 Feb 2008 09:34:51 +0000 (20 10:34 +0100)
committerOliver Pinter <oliver.pntr@gmail.com>
Mon, 21 Apr 2008 15:08:22 +0000 (21 17:08 +0200)
treec46d2d0fcf69641c3d5b8c0e2dc2cc54fa922c5f
parent0232995711395b1a4f1bc6af1bfc637ae8cd0d97
splice: only return -EAGAIN if there's hope of more data

sys_tee() currently is a bit eager in returning -EAGAIN, it may do so
even if we don't have a chance of anymore data becoming available. So
improve the logic and only return -EAGAIN if we have an attached writer
to the input pipe.

Reported by Johann Felix Soden <johfel@gmx.de> and
Patrick McManus <mcmanus@ducksong.com>.

Tested-by: Johann Felix Soden <johfel@users.sourceforge.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
fs/splice.c