Windows 10 fails to delete read-only files with SMB2
Using a Windows 10 client,
Create 2 files in CIFS share. 1 called Test-RO.txt and another one called
Test-RW.txt. Set "read-only" on file Test-RO.txt from Windows Explorer.
Delete both files. From Windows explorer, it appears that both files have
been deleted. Hit F5 to refresh Windows explorer window and the "Test-RO.txt"
file is still there.
If you disable SMB2 (and then reboot the client) the delete works OK.
Updated by Gordon Ross over 3 years ago
This was fixed in NexentaStor. See:
Before Windows 10, delete over SMB2 would normally NtCreate (open), set disposition "delete on close" and then close.
In Windows 10, they apparently try to accomplish delete using one fewer operation, so they NtCreate (read as "open") setting disposition "delete on close" as part of the open.
That sequence works for most files, but with read-only files it's supposed to return the error "cannot delete", which causes the client to fall-back to the old method.
Before this change, the SMB server did not return the "cannot delete" error soon enough. It needs to happen on the create, not later.
Updated by Electric Monk almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit b5b772b09624dfff0e83299d0f7b895129f7bf26 Author: Gordon Ross <email@example.com> Date: 2019-05-29T22:07:47.000Z 8583 Windows 10 fails to delete read-only files with SMB2 Reviewed by: Matt Barden <firstname.lastname@example.org> Reviewed by: Evan Layton <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>