Project

General

Profile

Actions

Bug #8583

closed

Windows 10 fails to delete read-only files with SMB2

Added by Gordon Ross almost 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2017-08-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

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.

Actions #1

Updated by Gordon Ross almost 6 years ago

This was fixed in NexentaStor. See:
https://github.com/Nexenta/illumos-nexenta/commit/f564212ea12aa1bf481b754336cb769400e41e50

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.

Actions #2

Updated by Gordon Ross about 4 years ago

Testing: per description.
Fix in production since mid 2017

Actions #3

Updated by Electric Monk almost 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit b5b772b09624dfff0e83299d0f7b895129f7bf26

commit  b5b772b09624dfff0e83299d0f7b895129f7bf26
Author: Gordon Ross <gwr@nexenta.com>
Date:   2019-05-29T22:07:47.000Z

    8583 Windows 10 fails to delete read-only files with SMB2
    Reviewed by: Matt Barden <matt.barden@nexenta.com>
    Reviewed by: Evan Layton <evan.layton@nexenta.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Actions

Also available in: Atom PDF