From: Changli Gao <xiaosuo@gmail.com>
To: Ofer Heifetz <oferh@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Splice status
Date: Mon, 5 Jul 2010 20:08:25 +0800 [thread overview]
Message-ID: <AANLkTikciGxxTR2a2aEASVxPp4PaHWV0BcyIPMLmRsgh@mail.gmail.com> (raw)
In-Reply-To: <EE71107DF0D1F24FA2D95041E64AB9E8ED2541B66E@IL-MB01.marvell.com>
On Mon, Jul 5, 2010 at 6:52 PM, Ofer Heifetz <oferh@marvell.com> wrote:
> I am using Samba, so from my understanding of the source code, it loops and performs splice(sock, pipe) and splice(pipe, fd). There is no flush of any sort in between.
>
I checked the function: sys_recvfile() and found It is buggy.
to_write = nread;
while (to_write > 0) {
int thistime;
thistime = splice(pipefd[0], NULL, tofd,
&splice_offset, to_write,
SPLICE_F_MOVE);
if (thistime == -1) {
goto done;
}
to_write -= thistime;
}
total_written += nread;
count -= nread;
When splice fails, it should drain the pipe. If not, the following
splice(2) to pipe may hang, because the pipe hasn't enough space for
the data read from socket.
> When you say drain you mean to flush all data to pipe?
>
No. I means to read all the data in the pipe.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
next prev parent reply other threads:[~2010-07-05 12:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 9:26 Splice status Ofer Heifetz
2010-07-05 9:59 ` Changli Gao
2010-07-05 10:52 ` Ofer Heifetz
2010-07-05 12:08 ` Changli Gao [this message]
2010-07-05 12:50 ` Eric Dumazet
2010-07-05 13:47 ` Ofer Heifetz
2010-07-05 15:34 ` Eric Dumazet
2010-07-06 2:01 ` Changli Gao
2010-07-06 2:36 ` Ofer Heifetz
2010-07-06 3:56 ` Eric Dumazet
2010-07-11 13:08 ` Changli Gao
2010-07-13 11:41 ` Ofer Heifetz
2010-07-13 12:32 ` Changli Gao
2010-07-13 12:42 ` Ofer Heifetz
2010-07-13 13:58 ` Changli Gao
2010-07-13 14:40 ` Ofer Heifetz
2010-07-13 14:11 ` Eric Dumazet
2010-07-14 15:08 ` Ofer Heifetz
2010-07-15 3:47 ` Ofer Heifetz
2010-07-25 14:47 ` Ofer Heifetz
2010-07-26 7:41 ` Changli Gao
2010-07-26 20:37 ` Jarek Poplawski
2010-07-26 20:50 ` Eric Dumazet
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=AANLkTikciGxxTR2a2aEASVxPp4PaHWV0BcyIPMLmRsgh@mail.gmail.com \
--to=xiaosuo@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=oferh@marvell.com \
/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).