lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1203452091.7758.5.camel@localhost>
Date:	Tue, 19 Feb 2008 21:14:51 +0100
From:	Johann Felix Soden <johfel@....de>
To:	Jens Axboe <jens.axboe@...cle.com>
Cc:	Patrick McManus <mcmanus@...ksong.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] splice: fix problem with sys_tee and SPLICE_F_NONBLOCK

From: Johann Felix Soden <johfel@...rs.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@...rs.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ