[PATCH] s3:vfs_fileid: add "fstype/mntdir deny/allow list" option

Christof Schmitt cs at samba.org
Fri Jan 15 17:08:57 UTC 2016


On Fri, Jan 15, 2016 at 10:36:53AM +0100, Ralph Wuerthner wrote:
> On 15/01/16 09:34, Ralph Boehme wrote:
> > On Thu, Jan 14, 2016 at 04:14:45PM -0800, Jeremy Allison wrote:
> >> On Thu, Jan 14, 2016 at 04:31:36PM +0100, Ralph Wuerthner wrote:
> >>> Hello,
> >>>
> >>> please see attached patch to fix an issue we encountered recently at a
> >>> customer.
> >>>
> >>> Regards
> >>>
> >>> 	Ralph
> >>>
> >>> PS: an alternative solution would be to pass the file path and the
> >>> SMB_STRUCT_STAT to the file_id_create function. This way no additional
> >>> options would be required, but I don't know if it's worth the effort to
> >>> change all file_id_create calls.
> >>
> >> Ugh. I gotta say I hate this :-). So this is a fix for Samba
> >> because NFS is utterly unreliable and causes clients to hang
> >> in the D wait-state ?
> >>
> >> This might be better as a local or IBM-specific patch :-).
> >>
> >> Or is the utility worth working around in Samba ?
> >>
> >> What do others think ?
> > 
> > Would it be possible to modify SMB_VFS_FILE_ID_CREATE() adding a
> > pathname parameter and statfs() that directly?
> 
> I did a quick check and there are about thirty places were
> SMB_VFS_FILE_ID_CREATE() is called via vfs_file_id_from_sbuf(). And we
> do not have a struct smb_fname available in all places. So this would
> result in a large code change and I don't know if it's worth the effort
> as vfs_fileid is only used in very few Samba installations.

Where is the smb_fname missing in the callers? I just grepped through
the code for callers of SMB_VFS_FILE_ID_CREATE or vfs_file_id_from_sbuf
and it seems like all callers have a filename around. An optimization
here could be providing two interfaces, one with a filename and the
other one with a fsp and use statfs and fstatfs respectively.

This should be a cleaner approach, since smbd would only access
filesystems that are actually exported through SMB. The only downside i
see would be the larger code changes to change the call to
SMB_VFS_FILE_ID_CREATE.

Christof



More information about the samba-technical mailing list