public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] splice: fix problem with sys_tee and SPLICE_F_NONBLOCK
@ 2008-02-19 20:14 Johann Felix Soden
  2008-02-19 20:25 ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Johann Felix Soden @ 2008-02-19 20:14 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Patrick McManus, linux-kernel

From: Johann Felix Soden <johfel@users.sourceforge.net>

With SPLICE_F_NONBLOCK sys_tee should return number of duplicated bytes,
not only -EAGAIN on success.

This patch also solves the problem, which is described on
http://article.gmane.org/gmane.linux.kernel/642502.

Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net>
---
 fs/splice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index 9b559ee..184fd66 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1711,7 +1711,7 @@ static long do_tee(struct file *in, struct file *out, size_t len,
 			ret = link_opipe_prep(opipe, flags);
 			if (!ret) {
 				ret = link_pipe(ipipe, opipe, len, flags);
-				if (!ret && (flags & SPLICE_F_NONBLOCK))
+				if (ret < 0 && (flags & SPLICE_F_NONBLOCK))
 					ret = -EAGAIN;
 			}
 		}
-- 
1.5.4.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-02-20 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 20:14 [PATCH] splice: fix problem with sys_tee and SPLICE_F_NONBLOCK Johann Felix Soden
2008-02-19 20:25 ` Jens Axboe
2008-02-19 21:12   ` Johann Felix Soden
2008-02-19 21:25     ` Jens Axboe
2008-02-19 21:47       ` Johann Felix Soden
2008-02-20  9:35         ` Jens Axboe
2008-02-20 10:07           ` Johann Felix v. Soden-Fr.
2008-02-20 10:39             ` Jens Axboe
2008-02-20 16:31           ` Patrick McManus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox