The client asks for write access on the snapshot file which fails when Samba does the POSIX open() with O_RDWR with EROFS. The interesting bit: Windows SMB server allows opening a snapshot file for writing, but fails any attempt to use the handle for writing with STATUS_MEDIA_WRITE_PROTECTED. See also: https://lists.samba.org/archive/cifs-protocol/2018-November/003185.html Possible fix: do the open O_RDONLY. Any subsequent write on the handle will fail with EINVAL, map that to EROFS.
Created attachment 14671 [details] Possible patch for master
Now waiting for dochelp...
Created attachment 14713 [details] Patch for 4.9 backported from master The patch for this bug must be pushed before #13455.
Comment on attachment 14713 [details] Patch for 4.9 backported from master Applies cleanly to 4.9.next, but not 4.8.next: Applying: vfs_shadow_copy2: nicely deal with attempts to open previous version for writing error: patch failed: source3/modules/vfs_shadow_copy2.c:3249 error: source3/modules/vfs_shadow_copy2.c: patch does not apply Patch failed at 0007 vfs_shadow_copy2: nicely deal with attempts to open previous version for writing Ralph, can you update for 4.8.next ?
Created attachment 14722 [details] Patch for 4.8 backported from master This one should work, sorry! No idea what happened, I generally cherry-pick on 4.9, then create a patchset which I apply with git am to 4.8. If it applies, I attach one patchset for both versions. Must have messed up something...
Let me reiterate that this one must be applied before bug #13455.
Re-assigning to Karolin for inclusion in 4.8.next, 4.9.next.
(In reply to Jeremy Allison from comment #7) Pushed to autobuild-v4-{9,8}-test.
(In reply to Karolin Seeger from comment #8) Pushed to both branches. Closing out bug report. Thanks!
This is not working anymore in recent Samba versions. Have patches...
*** Bug 15493 has been marked as a duplicate of this bug. ***
This bug was referenced in samba master: 78119edba013583555069271bb61134c12c2c135 c62484bc2c60ebac42635793d94cb8e62629acbf 537eedfe2a79fba2e1f062f14ba7a0c5f8f70a88 276c5bd851ab6ab818a49d9c47f6b96de8024778 76c8fe16bff36a29fa326355256b50737d04bd85 96b577c380fa914eb1ffa95849c82bdb88aa1ec6 bf497819e61131cfa6469971596af3aa9bd4bb49 a0ae45be770a13373c148a689b9761f14c4f942c ee3035218df4cfd68b6aab6825c78f2b85234c6c 995a31c8d4c1789c16bae6b8196f2565d4b1dfdb 02ed99343d19fd0845531ad99a46b1dd5b8a7a4f fd4e41144a819b4403340e4a28664ac586722b41 f14a7065690b00e3c6af2c1f0b0aec51c1e0b372
Created attachment 18222 [details] Patch for 4.19 backported from master
Created attachment 18223 [details] Patch for 4.18 backported from master
Pushed to autobuild-v4-{19,18}-test.
This bug was referenced in samba v4-19-test: b6c2c26e9ba02b6b7b0843e8a01344c774974dee bb9aea6a7e69b92d76cc09812de8887e1ea6930c a510fc46bcd0fc6e78d51eebdbbb7fbb44a134de b838378024966ac75119d6426380178f8c482a16 9ee7991d97dfc0aeaecc12816d6e7a34b74106e8 0f865a34f1a080e35ce6a4c19fec80a84c7b8dc9 8318428f3f8dbdbc7ff11f2755ae6b702049c72d 0352aae6ea1e8c38ca8ca091123ddde455c2e5ab bfa5f1780990e4f763f0214fb660c64c53188e65 44396d7bade98b41fb655e30d84195793684f593 f5eb449cac82de61c4eadc1b134c92896f69aacf 0874d3ab3e1cb7e42900da9543963799b864e485 cfbaab5654cc40ef08ab09492d20aac2f33cbf0e
This bug was referenced in samba v4-18-test: 29f629a155faae5945414b912a5f248c1d7fd43a 469c91c4133e18700a19558910449e59957afccd 7080c5b4850c39c63e61d458d5928151fa7f1c00 c8e1d26cea525c6d0642923bf1b5196813145744 d87294724e6066870346ff90b16c76fcfd294b9c b775434b7eb1a08fff283e153817f3e0376c9af8 8c08511f97d0915fdc87c77f4c5a815e1dcfb42a 8ee0768d6f2c1b79a4ad381f0cef1ae32a9618b7 15536403f631e757b8d3db77ea442cb858e03bd3 77a71bc9932acc7e73fe4b89443bf500c0374a98 d3f062e21224f720ca724dee740ade5d56748da1 1e108b3ac072ac396fc07f4cb4073217af2877bf ee2df0bbb3429ca2bece2b651e00182453d1b089
Closing out bug report. Thanks!
This bug was referenced in samba v4-18-stable (Release samba-4.18.10): 29f629a155faae5945414b912a5f248c1d7fd43a 469c91c4133e18700a19558910449e59957afccd 7080c5b4850c39c63e61d458d5928151fa7f1c00 c8e1d26cea525c6d0642923bf1b5196813145744 d87294724e6066870346ff90b16c76fcfd294b9c b775434b7eb1a08fff283e153817f3e0376c9af8 8c08511f97d0915fdc87c77f4c5a815e1dcfb42a 8ee0768d6f2c1b79a4ad381f0cef1ae32a9618b7 15536403f631e757b8d3db77ea442cb858e03bd3 77a71bc9932acc7e73fe4b89443bf500c0374a98 d3f062e21224f720ca724dee740ade5d56748da1 1e108b3ac072ac396fc07f4cb4073217af2877bf ee2df0bbb3429ca2bece2b651e00182453d1b089
This bug was referenced in samba v4-19-stable (Release samba-4.19.5): b6c2c26e9ba02b6b7b0843e8a01344c774974dee bb9aea6a7e69b92d76cc09812de8887e1ea6930c a510fc46bcd0fc6e78d51eebdbbb7fbb44a134de b838378024966ac75119d6426380178f8c482a16 9ee7991d97dfc0aeaecc12816d6e7a34b74106e8 0f865a34f1a080e35ce6a4c19fec80a84c7b8dc9 8318428f3f8dbdbc7ff11f2755ae6b702049c72d 0352aae6ea1e8c38ca8ca091123ddde455c2e5ab bfa5f1780990e4f763f0214fb660c64c53188e65 44396d7bade98b41fb655e30d84195793684f593 f5eb449cac82de61c4eadc1b134c92896f69aacf 0874d3ab3e1cb7e42900da9543963799b864e485 cfbaab5654cc40ef08ab09492d20aac2f33cbf0e