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!