Re: Splice status

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Changli Gao
Date: Monday, July 5, 2010 - 5:08 am

On Mon, Jul 5, 2010 at 6:52 PM, Ofer Heifetz <oferh@marvell.com> wrote:

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.


No. I means to read all the data in the pipe.


-- 
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Splice status, Ofer Heifetz, (Mon Jul 5, 2:26 am)
Re: Splice status, Changli Gao, (Mon Jul 5, 2:59 am)
RE: Splice status, Ofer Heifetz, (Mon Jul 5, 3:52 am)
Re: Splice status, Changli Gao, (Mon Jul 5, 5:08 am)
RE: Splice status, Eric Dumazet, (Mon Jul 5, 5:50 am)
RE: Splice status, Ofer Heifetz, (Mon Jul 5, 6:47 am)
RE: Splice status, Eric Dumazet, (Mon Jul 5, 8:34 am)
Re: Splice status, Changli Gao, (Mon Jul 5, 7:01 pm)
RE: Splice status, Ofer Heifetz, (Mon Jul 5, 7:36 pm)
Re: Splice status, Eric Dumazet, (Mon Jul 5, 8:56 pm)
Re: Splice status, Changli Gao, (Sun Jul 11, 6:08 am)
RE: Splice status, Ofer Heifetz, (Tue Jul 13, 4:41 am)
Re: Splice status, Changli Gao, (Tue Jul 13, 5:32 am)
RE: Splice status, Ofer Heifetz, (Tue Jul 13, 5:42 am)
Re: Splice status, Changli Gao, (Tue Jul 13, 6:58 am)
RE: Splice status, Eric Dumazet, (Tue Jul 13, 7:11 am)
RE: Splice status, Ofer Heifetz, (Tue Jul 13, 7:40 am)
RE: Splice status, Ofer Heifetz, (Wed Jul 14, 8:08 am)
RE: Splice status, Ofer Heifetz, (Wed Jul 14, 8:47 pm)
RE: Splice status, Ofer Heifetz, (Sun Jul 25, 7:47 am)
Re: Splice status, Changli Gao, (Mon Jul 26, 12:41 am)
Re: Splice status, Jarek Poplawski, (Mon Jul 26, 1:37 pm)
Re: Splice status, Eric Dumazet, (Mon Jul 26, 1:50 pm)