Trouble deleting files on SMB share on OmniOS?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

altano

Active Member
Sep 3, 2011
280
159
43
Los Angeles, CA
I have a ZFS pool shared out over SMB on OmniOS+napp-it. I just hit a weird issue: I created a test folder with a test file in it. When trying to delete this folder or file from a Windows machine over SMB, I got no errors but the folder would not delete. It was as if I did nothing.

So I ssh'd into the OmniOS host and just rm'd the file and directory: no errors, and now it's actually gone. Has anyone seen anything like this?
 

altano

Active Member
Sep 3, 2011
280
159
43
Los Angeles, CA
I was getting disk errors in the dmesg logs but that was a red herring. Where can I find logs related to the smb delete operation?

I have additional Windows ACLs but the user doing the delete was the owner of the whole directory tree and there were no permission errors.
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
One problem I am aware of is
Bug #8583: Windows 10 fails to delete read-only files with SMB2 - illumos gate - illumos.org

Another reason I have seen is when someone has the file open. With OSX I have seen such a problem persistent when the Mac crashed. A SMB service restart was needed (I have not waited to see if there was a timeout)

about log
Critical errors are in the system logs. You can also check the local console for messages.
For internals start the following at console prior delete (maybe for developers only)
dtrace -s /usr/lib/smbsrv/dtrace/smbsrv.d
 

altano

Active Member
Sep 3, 2011
280
159
43
Los Angeles, CA
FWIW in case anyone sees this in the future, the bug @gea linked to is exactly what I was hitting. I was able to verify because I hit it again: deleted files were silently remaining on the filesystem. I checked and they were read-only, and removing the read-only flag allowed them to be properly deleted.

*shrug*