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

Jones jones.kstw at gmail.com
Mon Apr 14 05:39:10 MDT 2014


2014-04-09 10:49 GMT+08:00 Jeremy Allison <jra at samba.org>:

> The patch as is should cope with EAGAIN correctly,
> but I'd be interested to see your test results.
>
>
Hello Jeremy, Metze,

The test result with different protocol looks good!
The client is windows 7,
drag-and-drop a single 8GB file from client to my linux box,
and network RTT is around 500ms.
(keep clicking apply buttons)

If the splice returned -1 with errno =  EAGAIN occurred twice successively,
the file transferring progress would be terminated,
a warning window prompted on client and said:
0x80070036: The network is busy.

The following is came from strace log with different negotiated protocol,
and only grep the keywords: splice and fcntl.

1) max protocol = SMB2_10
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 131072
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 131072
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 131072
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 125339
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 52560
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = 7300
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(31, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(31, F_SETFL, O_RDWR)            = 0
splice(0x1f, 0, 0xb, 0xffa41240, 0x20000, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl64(13, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=588, len=1},
0xffa41314) = 0
fcntl64(13, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=31936, len=1},
0xffa41314) = 0
...

2) max protocol = SMB2_02
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 65536
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 65536
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 65536
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 65536
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 46322
splice(0x1f, 0, 0x22, 0xffb986e0, 0x4b0e, 0) = 19214
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = 15710
splice(0x1f, 0, 0x22, 0xffb986e0, 0xc2a2, 0) = 7300
splice(0x1f, 0, 0x22, 0xffb986e0, 0xa61e, 0) = 14600
splice(0x1f, 0, 0x22, 0xffb986e0, 0x6d16, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(31, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(31, F_SETFL, O_RDWR)            = 0
splice(0x1f, 0, 0x22, 0xffb986e0, 0x10000, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl64(13, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=544, len=1},
0xffb987b4) = 0
fcntl64(13, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=31936, len=1},
0xffb987b4) = 0
...

3) max protocol = NT1
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = 32768
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = 32768
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = 32768
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = 5112
splice(0x1f, 0, 0xb, 0xffc01d20, 0x6c08, 0) = 21900
splice(0x1f, 0, 0xb, 0xffc01d20, 0x167c, 0) = 5756
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = 17536
splice(0x1f, 0, 0xb, 0xffc01d20, 0x3b80, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(31, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(31, F_SETFL, O_RDWR)            = 0
splice(0x1f, 0, 0xb, 0xffc01d20, 0x8000, 0) = -1 EAGAIN (Resource
temporarily unavailable)
fcntl64(31, F_SETFL, O_RDWR)            = 0
fcntl64(14, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=428, len=1},
0xffc01b74) = 0
fcntl64(14, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=16244, len=1},
0xffc01b74) = 0
...


--
Regards,
Jones


More information about the samba-technical mailing list