smbd/smb2_ioctl: instruct VFS to ignore locks for dup extents
authorDavid Disseldorp <ddiss@samba.org>
Thu, 4 May 2017 13:09:36 +0000 (15:09 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 10 May 2017 10:27:00 +0000 (12:27 +0200)
As described in the previous commit - Windows Server 2016 (ReFS) ignores
locks for FSCTL_DUPLICATE_EXTENTS_TO_FILE. Do the same for Samba.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 10 12:27:00 CEST 2017 on sn-devel-144

source3/smbd/smb2_ioctl_filesys.c

index 9a44dba5224d073f35288c15e368ce8b6c3a6672..fbff97cc8300aecc9f10787ccc4bcfcb91c26c3f 100644 (file)
@@ -256,11 +256,13 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
                return tevent_req_post(req, ev);
        }
 
+       /* tell the VFS to ignore locks across the clone, matching ReFS */
        subreq = SMB_VFS_COPY_CHUNK_SEND(dst_fsp->conn, state, ev,
                                         src_fsp, state->dup_extents.source_off,
                                         dst_fsp, state->dup_extents.target_off,
                                         state->dup_extents.byte_count,
        subreq = SMB_VFS_COPY_CHUNK_SEND(dst_fsp->conn, state, ev,
                                         src_fsp, state->dup_extents.source_off,
                                         dst_fsp, state->dup_extents.target_off,
                                         state->dup_extents.byte_count,
-                                        VFS_COPY_CHUNK_FL_MUST_CLONE);
+                                        VFS_COPY_CHUNK_FL_MUST_CLONE
+                                        | VFS_COPY_CHUNK_FL_IGNORE_LOCKS);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }