[PATCH] vfs_shadow_copy2: add snapsharepath parameter

Uri Simchoni uri at samba.org
Fri Jan 22 10:08:35 UTC 2016

On 01/21/2016 10:44 PM, Michael Adam wrote:
> I don't see yet that the snapsharepath really gains anything. Will 
> follow up with details. Michael 
The use case is as follows:

In the original volume we have:

And we have 2 shares:
path = /mount/dir1

path = /mount/dir2/subdir

Now suppose we have a backup system that backs up not the whole volume, 
just the shares, and exposes snapshots to the user according to the 
logical structure as follows (this is the file-system view of the 

           + at GMT-XXX/
           |        +share1
           |        |
           |        +share2
           + at GMT-YYY/

In that case the existing shadow_copy2 parameters would not suffice, but 
snapsharepath (the relative path of the share inside the snapshot) would 
do it.

I know of no FOSS project that would benefit from this but at Ctera 
that's the way our snapshots are laid out.

Internally at vfs_shadow_copy2, the code uses rel_connectpath to find 
the share inside the snapshot, so adding this parameter (which 
essentially externalizes rel_connectpath) is a relatively small change. 
Functionally, snapsharepath is a super-set of basedir, but the advantage 
of basedir is that you can define it only once in [global] in some cases.


More information about the samba-technical mailing list