[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTikciGxxTR2a2aEASVxPp4PaHWV0BcyIPMLmRsgh@mail.gmail.com>
Date: Mon, 5 Jul 2010 20:08:25 +0800
From: Changli Gao <xiaosuo@...il.com>
To: Ofer Heifetz <oferh@...vell.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: Splice status
On Mon, Jul 5, 2010 at 6:52 PM, Ofer Heifetz <oferh@...vell.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@...il.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists