recvfile by linux splice
Lin Mac
mkl23 at hotmail.com
Wed Sep 24 06:12:43 GMT 2008
hi,
> It looks like you're moving Samba's triggering of the kernel bug around :-(.
Sorry that I'm not quiet understand what you mean.
Is the splice thing or the while loop is done in purpose?
Is it because the Linux splice have bug?
I'm confused somehow...
Best Regards,
Mac Lin
> Date: Tue, 23 Sep 2008 15:43:50 -0700
> From: jra at samba.org
> To: mkl23 at hotmail.com
> CC: samba-technical at lists.samba.org; jra at samba.org; volker.lendecke at sernet.de
> Subject: Re: recvfile by linux splice
>
> On Tue, Sep 23, 2008 at 07:42:36PM +0800, Lin Mac wrote:
> >
> > hi,
> >
> > I've been trying to make the Linux splice work in samba. I'm using Linux 2.6.26.3 and samba-3.2.2
> > With splice tool at http://brick.kernel.dk/snaps/splice-git-latest.tar.gz, and doing the test by running:
> > # ./splice-fromnet 2001 | ./splice-out -m /dev/null
> > # cat /dev/zero | netcat localhost 2001
> > I think splice(socket to pipe)+splice(pipe to file) should work in Linux 2.6.26.3.
> >
> > Using the original code of samba, splice would always failed due to splice directly from a socket to a file in samba. Linux require one of the input/output descriptor to be a pipe (FIFO) (http://linux.die.net/man/2/splice), so I made a little modification with the following patch to make it work.
> >
> > 1. change splice(socket to file) to splice (socket to pipe)+splice (pipe to file)
> > 2. the while (total_written < count) cause part of the data won't be written to file, so I changed it to while (count!=0). And I have no idea what while (total_written < count) and the latter drain_socket are used for...
> >
> > Now splice worked for small file ( <500kB), but larger files might failed (>800kB).
> > Now I'm stuck again...
>
> It looks like you're moving Samba's triggering of the kernel bug around :-(.
>
> Jeremy.
_________________________________________________________________
5 GB ¶W¤j®e¶q ¡B³Ð·s«K±¶¡B¦w¥þ¨¾Å@©U§£¶l¥ó©M¯f¬r ¡X ¥ß§Y¤É¯Å Windows Live Hotmail
http://mail.live.com
More information about the samba-technical
mailing list