[PATCH] pathname cleanups

Uri Simchoni uri at samba.org
Fri May 19 06:11:49 UTC 2017


On 05/19/2017 07:54 AM, Volker Lendecke via samba-technical wrote:
> On Thu, May 18, 2017 at 08:40:57PM -0700, Jeremy Allison via samba-technical wrote:
>> I'm getting ready to move the @GMT snapshot
>> name handling into struct smb_filename to
>> clean up a lot of the shadow_copy2 code.
> 
> As you mention it: I've got a report from a customer that a certain
> access pattern does not work anymore: GPFS has the ability to show the
> .snapshots directory (the one where all the @GMT- subdirs show up) in
> all directories, with @GMT- subdirectories being relative to the
> current dir.
> 
> For clients that do not understand the @GMT- logic or the timewarp
> token, essentially all non-windows clients, we need to be able to
> access previous versions through the subdir/.snapshots/@GMT-../subdir
> path. I think in the shadow_copy2 module we need to also preserve the
> non-stripped name and try with that also. Any other ideas?
> 
> Thanks, Volker
> 
Actually putting the timewarp timestamp into a separate field would
clean that nicely - if the timestamp is not assigned (zero?), then this
is a regular path and shadow_copy2 does not intervene. If it's assigned,
vfs_shadow_copy2 modifies the path. If we re-enter vfs_shadow_copy2, it
enters as a regular path. SMB2 becomes really clean that way.

With SMB1 clients, the @GMT comes as first path element, so the SMB1
server converts that into a timewarp element and strips it off the path
- that too supports regular clients which want to access
path/.snapshots/@GMT. Admittedly, this involves a bit of heuristics.
There's FLAGS2_REPARSE_PATH bit in FLAGS2 - Windows clients set it and
also Samba client since 4.6.x. The server can decide whether to be
strict about it or use the heuristic (currently smbd ignores this flag).

Thanks,
Uri



More information about the samba-technical mailing list