When copying a file on a Windows 8.1 machine from a server from one share to an other (same server), server side copy seems not to be used. It took 3 seconds longer to copy the same 700 MB file on Win 8.1 than on Windows 7. Client: Windows 8.1 (incl. all Updates until Jun. 2014) Server: Samba 4.1.8 server max protocol = SMB3 (default) Also tried: server max protocol = SMB2_10 I already talked to David Disseldorp today on IRC about that. He'll add some notes to this bug report.
Created attachment 10033 [details] Wireshark capture from Samba to Samba server This capture if from a copy process executed on the Win8.1 machine from one share to an other (same server).
My initial thoughts were that the Windows SMB client behaviour had changed between Windows Server 2012 and 8.1, whereby with 2012 the SMB client first attempts the server-side copy using an initial FSCTL_OFFLOAD_READ and falls back to using FSCTL_SRC_COPYCHUNK failure, and with 8.1 the FSCTL_SRC_COPYCHUNK fall back does not occur. However, since then I've tested Windows 8.1 (enterprise) manually, and can't for the life of me reproduce the immediate read/write (without copychunk) fallback that Marc is seeing.
Created attachment 10034 [details] network capture of Windows 8.1 Enterprise -> Samba ~4.1
Marc, I just noticed that you don't appear to be coping the files on the same share. The source file resume key is associated with the open file table for the destination share connection, meaning that both need to be on the same connection. Please retry, with both the source and destination file on the same share. I'll update the wiki with this requirement.
Created attachment 10035 [details] Wireshark Capture of a copy on the same share Attached a capture of copying a 1MB file on the same share. There it seems to work. Then I tried copying a 430 MB file (not part of the capture). On Win81 it's copied in 1 second. On Win7 it needs about 20 sec. So was it just a lack of information? Does server side copy is just working on the same share and not across shares on the same server? I think we should be more detailed in the documentation what the requirements are for server side copy. And also add a section what the SMB specs would allow, but isn't implemented yet. Then people could better decite if it's worth installing Win8 just to get server side copy. ;-)
(In reply to comment #5) > Created attachment 10035 [details] > Wireshark Capture of a copy on the same share > > Attached a capture of copying a 1MB file on the same share. There it seems to > work. > > > Then I tried copying a 430 MB file (not part of the capture). On Win81 it's > copied in 1 second. On Win7 it needs about 20 sec. > > > So was it just a lack of information? Does server side copy is just working on > the same share and not across shares on the same server? FSCTL_SRV_COPYCHUNK server-side copies are only requested by Windows 8+ clients on the same share. Samba also requires that the source and destination file handles are associated with the same connection. The new FSCTL_OFFLOAD_READ/FSCTL_OFFLOAD_WRITE server-side copy ioctls don't appear to be constrained by the same machine / share requirements. Instead, the server-side copy tokens are generated by the block storage backend, which then cooperates to move the data around. See the ODX section in http://www.snia.org/sites/default/files2/SDC2011/presentations/monday/NealChristiansen_Win8FileSystemPerformance.pdf > I think we should be more detailed in the documentation what the requirements > are for server side copy. And also add a section what the SMB specs would > allow, but isn't implemented yet. Then people could better decite if it's worth > installing Win8 just to get server side copy. ;-) I agree. I'll add some extra detail to the wiki today, and then close this bug.
(In reply to comment #6) ... > I agree. I'll add some extra detail to the wiki today, and then close this bug. Done, closing. @Marc, please review the added text - thanks!
(In reply to comment #7) > @Marc, please review the added text - thanks! Done. Thanks. I restructured the page a bit and add some more information with less technical words, that may make it easier for endusers to understand what's needed and how it works. :-) https://wiki.samba.org/index.php/Server-Side_Copy