splice: only return -EAGAIN if there's hope of more data
commit540add1b55bcae67e16feede0a5f0a0163db3c12
authorJens Axboe <jens.axboe@oracle.com>
Wed, 20 Feb 2008 09:34:51 +0000 (20 10:34 +0100)
committerOliver Pinter <oliver.pntr@gmail.com>
Thu, 1 May 2008 13:40:26 +0000 (1 15:40 +0200)
tree37c932402ae81960e02894f24017eedefa9985b1
parent4f38274e8346ef5748c667c3f1f73067e7f57e75
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