linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Changli Gao <xiaosuo@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, matthew@wil.cx,
	mszeredi@suse.cz, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v2 3/4]: sendfile: remove flags paramter of do_splice_direct()
Date: Sat, 29 May 2010 09:59:00 +0800	[thread overview]
Message-ID: <AANLkTimCXzrXcfwbCy5MZ3D40WBnGbF6Kbj6egTSjk2s@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimzsHAxha3vQxeFn5pF5BmYZ8nLawSG2YU3eujZ@mail.gmail.com>

On Fri, May 28, 2010 at 6:06 PM, Changli Gao <xiaosuo@gmail.com> wrote:
> On Fri, May 28, 2010 at 5:40 PM, Miklos Szeredi <miklos@szeredi.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@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-05-29  1:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 14:44 [PATCH v2 3/4]: sendfile: remove flags paramter of do_splice_direct() Changli Gao
2010-05-28  9:40 ` Miklos Szeredi
2010-05-28 10:06   ` Changli Gao
2010-05-29  1:59     ` Changli Gao [this message]
2010-05-29 16:20       ` Steven Rostedt
2010-05-29 23:58         ` Changli Gao
2010-05-30  0:39           ` Steven Rostedt
2010-05-30  3:25             ` Changli Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimCXzrXcfwbCy5MZ3D40WBnGbF6Kbj6egTSjk2s@mail.gmail.com \
    --to=xiaosuo@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=eric.dumazet@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=miklos@szeredi.hu \
    --cc=mingo@redhat.com \
    --cc=mszeredi@suse.cz \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).