On Thu, 27 Oct 2016 14:50:48 -0700, Jeremy Allison <jra at samba.org> wrote :> On Thu, Oct 27, 2016 at 11:27:29PM +0200, Saint Germain via samba > wrote: > > Hello, > > > > I would like to test Samba server-side copy with BTRFS: > > https://wiki.samba.org/index.php/Server-Side_Copy#Btrfs_Enhanced_Server-Side_Copy_Offload > > > > However it is not clear which server/client configuration I should > > use. > > > > As far as I understand on the server-side, I should have at least > > Samba 4.1 on a BTRFS filesystem (with vfs objects = btrfs in the > > share). > > > > But on the client side, what can I use ? > > > > There is a warning on the page that: > > "the client's FSCTL_SRV_COPYCHUNK server-side copy request must be > > Btrfs filesystem aligned" > > > > Digging a little more, I found some explanations here: > > https://lists.samba.org/archive/samba-technical/2013-September/095135.html > > > > > with Samba and Btrfs the request latency will be > > > heavily effected by whether the FSCTL_SRV_COPYCHUNK wire request > > > byte offsets and lengths align to the Btrfs sector-size (4K by > > > default IIRC). > > > If they do align, then each chunk in the request can be mapped to > > > a BTRFS_IOC_CLONE_RANGE ioctl. Otherwise, we need to fall back to > > > a server-side local read/write. > > > > > > We should be able to provide underlying filesystem alignment > > > requirements to SMB clients via the new > > > FileFSSectorSizeInformation ioctl, but it's not currently > > > supported by Samba. > > > > So which client platform (Windows, Mac, Linux) and which client > > software (smb, cifs, etc.) can I use to test this ? > > Server-side copy can be requested using smbclient, using > the "scopy" command. > > It's a simple: > > scopy source destThanks but I just tested and it doesn't trigger BTRFS_IOC_CLONE_RANGE. The server-side copy is working all right, but the file is not copied through BTRFS reflink (cp --reflink=auto). It is quite noticeable on large file, where it should be nearly instantaneous. My configuration: - client: Debian Stable + smbclient 4.4.6 (coming from Testing) + kernel 4.7 (amd64) - server: Debian Stable + samba 4.2.10 + kernel 4.7 (amd64)
On Fri, Oct 28, 2016 at 12:08:50AM +0200, Saint Germain via samba wrote:> On Thu, 27 Oct 2016 14:50:48 -0700, Jeremy Allison <jra at samba.org> > wrote : > > > > Server-side copy can be requested using smbclient, using > > the "scopy" command. > > > > It's a simple: > > > > scopy source dest > > Thanks but I just tested and it doesn't trigger BTRFS_IOC_CLONE_RANGE. > The server-side copy is working all right, but the file is not copied > through BTRFS reflink (cp --reflink=auto). > It is quite noticeable on large file, where it should be nearly > instantaneous. > > My configuration: > - client: Debian Stable + smbclient 4.4.6 (coming from Testing) + > kernel 4.7 (amd64) > - server: Debian Stable + samba 4.2.10 + kernel 4.7 (amd64)OK, follow though using debug level 10 and see why it isn't selecting the reflink code. Are you using SMB2 ?
On Thu, 27 Oct 2016 15:39:27 -0700, Jeremy Allison <jra at samba.org> wrote :> On Fri, Oct 28, 2016 at 12:08:50AM +0200, Saint Germain via samba > wrote: > > On Thu, 27 Oct 2016 14:50:48 -0700, Jeremy Allison <jra at samba.org> > > wrote : > > > > > > Server-side copy can be requested using smbclient, using > > > the "scopy" command. > > > > > > It's a simple: > > > > > > scopy source dest > > > > Thanks but I just tested and it doesn't trigger > > BTRFS_IOC_CLONE_RANGE. The server-side copy is working all right, > > but the file is not copied through BTRFS reflink (cp > > --reflink=auto). It is quite noticeable on large file, where it > > should be nearly instantaneous. > > > > My configuration: > > - client: Debian Stable + smbclient 4.4.6 (coming from Testing) + > > kernel 4.7 (amd64) > > - server: Debian Stable + samba 4.2.10 + kernel 4.7 (amd64) > > OK, follow though using debug level 10 and see why it isn't > selecting the reflink code. > > Are you using SMB2 ?No I was using SMB1: my mistake. Now with SMB2, it works, thanks ! If I can ask, what is this restrictions with "Btrfs filesystem aligned" and "FSCTL_SRV_COPYCHUNK wire request byte offsets and lengths align to the Btrfs sector-size" ? Is it a restriction on the server or the client ? How can I check that I don't have this restriction ? Thanks for your help !