SMB Share Permission Error for Renaming Folders

dfkjhdbdf

Cadet
Joined
Nov 29, 2018
Messages
5
Dear all,

I am very new to Linux and FreeNas.

I currently am accessing my FreeNas through a Mac via SMB.

Sometimes, for some reason, when I create a Folder and place files into the folder, I couldn't rename them - I will get a permission error stating that I do not have permission to rename it. I could not delete the folder too.

However, after removing files from the folder, I could delete and rename folders.

This apply happens to all files. It happens sometimes, but not all the time too. Please help thank you!!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545
Dear all,

I am very new to Linux and FreeNas.

I currently am accessing my FreeNas through a Mac via SMB.

Sometimes, for some reason, when I create a Folder and place files into the folder, I couldn't rename them - I will get a permission error stating that I do not have permission to rename it. I could not delete the folder too.

However, after removing files from the folder, I could delete and rename folders.

This apply happens to all files. It happens sometimes, but not all the time too. Please help thank you!!


There's an issue where Macs post-Sierra will set RH leases on AFP_Resource xattrs and then not release them on file close. This causes renames (and potentially deletes) to fail. One mitigation is as follows:
Option 1:
1) enable vfs_fruit on all shares
2) set the following auxiliary parameters on all shares
Code:
fruit:metadata = stream
fruit:resource = stream

3) remount from OS-X client.
4) verify that fruit is working properly (from OS-X terminal)
smbutil statshares -a
The FreeNAS mount should be identified as an OS-X server

Option 2:
Set smb2 leases = no
 

dfkjhdbdf

Cadet
Joined
Nov 29, 2018
Messages
5
There's an issue where Macs post-Sierra will set RH leases on AFP_Resource xattrs and then not release them on file close. This causes renames (and potentially deletes) to fail. One mitigation is as follows:
Option 1:
1) enable vfs_fruit on all shares
2) set the following auxiliary parameters on all shares
Code:
fruit:metadata = stream
fruit:resource = stream

3) remount from OS-X client.
4) verify that fruit is working properly (from OS-X terminal)
smbutil statshares -a
The FreeNAS mount should be identified as an OS-X server

Option 2:
Set smb2 leases = no

Thank you! Will try this out and see if the problem still exists.
 

dfkjhdbdf

Cadet
Joined
Nov 29, 2018
Messages
5
Hi the problem still exists. I am still unable to delete some files it will have an error on a Mac stating that another user is still using it. However, I do not have another user on it. Is there another solution for this? Thank you so much!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545
Short term: create a "Trash" directory (i.e. a directory named trash) at the root of your share and move the files there (drag and drop). Once they're moved, you should be able to either delete them manually or schedule a cronjob to flush it out nightly or weekly.

Long term: I'm comparing differences between our 4.7 branch and upstream 4.7.12. We may resync with upstream for an 11.2 release because of some issues I've seen in Mojave.
 

waldenc1

Cadet
Joined
Mar 11, 2019
Messages
1
This is a rather pesky bug that I just spent a week of my life pouring through smb logs and tracking this down.

Adding this to your smb.conf will fix the problem.

[global]
vfs objects = catia fruit streams_xattr
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,545
This is a rather pesky bug that I just spent a week of my life pouring through smb logs and tracking this down.

Adding this to your smb.conf will fix the problem.

[global]
vfs objects = catia fruit streams_xattr
'catia' and 'fruit' can be manually added to the shares through the webui by clicking the "advanced button" and using the "vfs objects" field.
 
Top