Bug 11317 - Implement OS X style copyfile in vfs_fruit
Summary: Implement OS X style copyfile in vfs_fruit
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-08 10:47 UTC by Ralph Böhme
Modified: 2015-08-18 11:41 UTC (History)
1 user (show)

See Also:


Attachments
Patch for master (14.44 KB, patch)
2015-06-09 10:34 UTC, Ralph Böhme
no flags Details
Patch for master (14.36 KB, patch)
2015-06-09 11:08 UTC, Ralph Böhme
no flags Details
Patch for master (33.27 KB, patch)
2015-06-10 13:59 UTC, Ralph Böhme
no flags Details
Patch for master (32.91 KB, patch)
2015-06-15 08:18 UTC, Ralph Böhme
no flags Details
Patch for master (35.30 KB, patch)
2015-06-15 17:08 UTC, Ralph Böhme
no flags Details
Patch for master (36.67 KB, patch)
2015-06-17 08:43 UTC, Ralph Böhme
no flags Details
Patch for 4.2 cherry-picked from master (33.40 KB, patch)
2015-08-10 16:33 UTC, Ralph Böhme
metze: review-
Details
Patch for 4.2 cherry-picked from master (33.23 KB, patch)
2015-08-11 10:31 UTC, Ralph Böhme
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2015-06-08 10:47:43 UTC
OS X SMB server and client use a special copychunk semantic that is triggered by a chunk size of zero.

In response to this request, the server must copy the whole file at once and also copy all attached file metadata.

OS X clients have a bug in the moment leading to file corruption if using standard copychunk ioctl with file sizes over 2^31 bytes, so this OS X style copyfile/copychunk ioctl can be used as a workaround until Apple fixed their client.

Note that is indeed a single sync request that is expected to block the server while the copy is in progress.
Comment 1 Ralph Böhme 2015-06-09 10:34:39 UTC
Created attachment 11133 [details]
Patch for master
Comment 2 Ralph Böhme 2015-06-09 11:08:18 UTC
Created attachment 11134 [details]
Patch for master

Removes a debug log statement and ups a loglevel compared to the previous patch.
Comment 3 Ralph Böhme 2015-06-10 13:59:06 UTC
Created attachment 11143 [details]
Patch for master

Added torture tests to the patchset.
Comment 4 Ralph Böhme 2015-06-15 08:18:03 UTC
Created attachment 11152 [details]
Patch for master
Comment 5 Ralph Böhme 2015-06-15 17:08:13 UTC
Created attachment 11156 [details]
Patch for master

Patch is also in my copyfile branch.
Comment 6 Ralph Böhme 2015-06-17 08:43:35 UTC
Created attachment 11168 [details]
Patch for master
Comment 7 Ralph Böhme 2015-08-10 16:33:23 UTC
Created attachment 11324 [details]
Patch for 4.2 cherry-picked from master

Can we get this into 4.2? Eases applying subsequent vfs_fruit bugfixes.
Comment 8 Stefan Metzmacher 2015-08-11 06:32:02 UTC
Comment on attachment 11324 [details]
Patch for 4.2 cherry-picked from master

I think for the 4.2 backport we create copies instead of changing functions.
files_struct should also get the new member at the end.
Comment 9 Ralph Böhme 2015-08-11 10:31:08 UTC
Created attachment 11327 [details]
Patch for 4.2 cherry-picked from master

Updated patchset with new internal transfer_file func and the new option moved to the end of the struct.

Fwiw, the stream-names patchset must be pushed on-top of this one. :)
Comment 10 Stefan Metzmacher 2015-08-17 20:15:00 UTC
Pushed to autobuild-v4-2-test
Comment 11 Stefan Metzmacher 2015-08-18 11:41:13 UTC
Pushed to v4-2-test