[PATCH] Fix bug 9412 - SMB2 server doesn't support recvfile.

Jeremy Allison jra at samba.org
Thu Apr 17 10:10:13 MDT 2014

On Thu, Apr 17, 2014 at 02:29:46PM +0800, Jones wrote:
> 2014-04-17 3:28 GMT+08:00 Jeremy Allison <jra at samba.org>:
>      Once the input socket is set to blocking
>      mode, then the only way splice() can
>      return EAGAIN is if the flag SPLICE_F_NONBLOCK
>      is passed into splice - which we don't
>      do.
>      So I can't currently see any way that
>      splice can return EAGAIN once the
>      input socket is set to blocking mode.
>      Are you using a custom splice() call ?
>      If not, what kernel are you using so
>      I can look at exactly the source code
>      you have ?
> Hello Jeremy,
> Yes! Im using a custom splice call,
> not just the normal kernel splice.
> Look at the sys_recvfile, 
> the flag SPLICE_F_NONBLOCK is not passed into splice,
> but the EAGAIN still returned on my testing.
> Hmm maybe this is because the custom kernel part did it,
> i would try to dig further,
> thanks you.

Yeah, I'm pretty sure it's the custom
splice that's returning EAGAIN.

I traced through all the tcp splice
functions, and all the pipe splice
functions, and it's impossible for
any of the normal ones to return
EAGAIN unless the socket flags or
splice flags have O_NONBLOCK set.

(and remember your trace shows
EAGAIN coming back explicitly
after we've remove the O_NONBLOCK
from the socket flag).


More information about the samba-technical mailing list