splice: fix direct splice error handling
commit88bf3e2706e93abe55e7c0c95b9433e7a3f0b15b
authorJens Axboe <jens.axboe@oracle.com>
Thu, 20 Sep 2007 11:36:30 +0000 (20 13:36 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 Sep 2007 17:54:39 +0000 (26 10:54 -0700)
tree44387df15efbaca6faebe1e68f7826d38cb43e10
parenta3a066bffd7754e6d40c48972e698352f6cd6c4e
splice: fix direct splice error handling

This is a splice patch for 2.6.22 and 2.6.21 (and earlier, I did not
check. Let me know if you still maintain older stable trees!). It fixes
an infinite loop in do_splice_direct(), when there's either nothing to
read or nothing to write and blocking doesn't help. It could be things
like running out of disk space. We need to exit both for failure and
zero return, or we could be going around forever.

This got fixed in 2.6.23-git with commit 51a92c0f6ce8fa85fa0e18ecda1d847e606e8066

Herbert Poetzl <herbert@13thfloor.at> noticed this bug in 2.6.22, and
has verified that this minimal fix works.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/splice.c