[PATCH] shadow_copy2: mount_point is valid only for locally mountable file-system

Jeremy Allison jra at samba.org
Tue Oct 11 00:11:11 UTC 2016

On Fri, Sep 30, 2016 at 01:31:58PM +0530, Rajesh Joseph wrote:
> shadow_copy2 currently assumes that all the underlying file-system are
> mountable and
> are mounted on samba server. But this may not be true for all cases, e.g.
> GlusterFS is
> accessed via libgfapi and is not mounted.
> This can lead to connection failure if such file-systems are used along
> with shadow_copy2.
> The attached patch assume "/" as the default mount-point in such cases
> instead of failing
> the connect.
> This may not be a complete fix because shadow_copy2_find_mount_point can
> return wrong
> mount_point if by coincidence the "connectpath" is actually present in the
> local file-system.
> I had a brief discussion on this with Michael, and we think that it might
> be good if VFS layer
> can tell if the underlying file-system is mountable or not.
> It would be great to know what others think on this problem.

Yeah, setting it to "/" can also cause problems here:

2613         } else {
2614                 config->snapshot_basepath = talloc_asprintf(config, "%s/%s",
2615                                 config->mount_point, config->snapdir);
2616                 if (config->snapshot_basepath == NULL) {
2617                         DEBUG(0, ("talloc_asprintf() failed\n"));
2618                         errno = ENOMEM;
2619                         return -1;
2620                 }
2621         }

Let me think some more about what "connectpath" should be in
this case.

We have an existing VFS function SMB_VFS_CONNECTPATH(), maybe
this should be expanded to have a different meaning when
we're dealing with a completely virtual underlying FS.


More information about the samba-technical mailing list