Samba master if mount with "posix" then FSCTL_SRV_COPYCHUNK_WRITE will return "STATUS_INVALID_HANDLE" where the same thing works fine if you mount without "posix". Client requests an access_mask including FILE_APPEND_DATA on the destination handle which lets us take the true path in this if condition if (posix_open && (access_mask & FILE_APPEND_DATA)) { flags |= O_APPEND; } so we open the destination file with O_APPEND. This then failes in copy_file_range() because O_APPEND is not allowed on the destination file handle.
This bug was referenced in samba master: aa0d0e3c91f914464d7b22391d74be9845cf17f9 5c7b8793d753fe47720a95cff3fad72827ca4f82 63d59c15bb81daf55d21bbab1d868f034d125a78 c9001999ca3e3a43e197767420dd7649dad4f858 5c36cd2b9e6e2df7b9bedef71a9ba32820d89449 47c5d97d82b4ed6ad3cd4bf91b5824234af1b319