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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimCXzrXcfwbCy5MZ3D40WBnGbF6Kbj6egTSjk2s@mail.gmail.com>
Date:	Sat, 29 May 2010 09:59:00 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	axboe@...nel.dk, viro@...iv.linux.org.uk, matthew@....cx,
	mszeredi@...e.cz, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v2 3/4]: sendfile: remove flags paramter of 
	do_splice_direct()

On Fri, May 28, 2010 at 6:06 PM, Changli Gao <xiaosuo@...il.com> wrote:
> On Fri, May 28, 2010 at 5:40 PM, Miklos Szeredi <miklos@...redi.hu> wrote:
>> On Wed, 26 May 2010, Changli Gao wrote:
>>> remove flags paramter of do_splice_direct().
>>>
>>> the flags parameter of do_splice_direct() doesn't mean non-block read of
>>> in file,
>>
>> Actually, it does.  Look at the SPLICE_F_NONBLOCK usage in
>> __generic_splice_file_read().
>>
>
> Oh, I checked the code again. You're right. However, why don't we
> check the flags of in file instead in __generic_file_splice_read()?
>

I am afraid that __generic_file_splice_read() should not use SPLICE_F_NONBLOCK.

Here is the comment from the commit 42324c62704365d6a3e89138dea55909d2f26afe :

<<EOF
Linus introduced  SPLICE_F_NONBLOCK in commit
29e350944fdc2dfca102500790d8ad6d6ff4f69d
(splice: add SPLICE_F_NONBLOCK flag )

  It doesn't make the splice itself necessarily nonblocking (because the
  actual file descriptors that are spliced from/to may block unless they
  have the O_NONBLOCK flag set), but it makes the splice pipe operations
  nonblocking.

Linus intention was clear : let SPLICE_F_NONBLOCK control the splice
pipe mode only
EOF

And I have greped the whole code:

fs/splice.c:            if (spd->flags & SPLICE_F_NONBLOCK) {
fs/splice.c:                    if (flags & SPLICE_F_NONBLOCK) {
fs/splice.c:            if (sd->flags & SPLICE_F_NONBLOCK)
fs/splice.c:                    if (flags & SPLICE_F_NONBLOCK) {
fs/splice.c:            if (flags & SPLICE_F_NONBLOCK) {
fs/splice.c:                    if (flags & SPLICE_F_NONBLOCK) {
fs/splice.c:    if (!ret && ipipe->waiting_writers && (flags &
SPLICE_F_NONBLOCK))
fs/splice.c: * applicable one is SPLICE_F_NONBLOCK.
include/linux/splice.h:#define SPLICE_F_NONBLOCK (0x02) /* don't block
on the pipe splicing (but */
kernel/relay.c:                 if (flags & SPLICE_F_NONBLOCK)
kernel/trace/trace.c:           if (flags & SPLICE_F_NONBLOCK)

besides the __generic_file_splice_read(), there are two users: relay
and trace. I believe they all misuse this flag.

-- 
Regards,
Changli Gao(xiaosuo@...il.com)
--
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