Bug 13091 - Sub-directory share of a GlusterFS volume not accessible with shadow_copy2 vfs module
Summary: Sub-directory share of a GlusterFS volume not accessible with shadow_copy2 vf...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.7.0
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-17 13:25 UTC by Anoop C S
Modified: 2020-01-03 09:02 UTC (History)
4 users (show)

See Also:


Attachments
testparm -s (1.13 KB, text/plain)
2017-10-17 13:25 UTC, Anoop C S
no flags Details
patch for 4.7 (1.90 KB, patch)
2017-10-23 06:29 UTC, Anoop C S
jra: review+
gd: review+
Details
patch for 4.6 (1.90 KB, patch)
2017-10-23 06:30 UTC, Anoop C S
jra: review+
gd: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anoop C S 2017-10-17 13:25:05 UTC
Created attachment 13700 [details]
testparm -s

Consider a standalone Samba server setup where sub-directory inside a GlusterFS volume is shared along with shadow_copy2 vfs module. Following errors were seen in logs while such a share is inaccessible from client:

[2017/10/17 18:42:30.593790,  0] ../source3/modules/vfs_glusterfs.c:361(vfs_gluster_connect)
  vfs_gluster_connect: xcube: Initialized volume from servers localhost
[2017/10/17 18:42:30.595472,  1] ../source3/modules/vfs_shadow_copy2.c:3083(shadow_copy2_connect)
  shadow_copy2_connect: shadow_copy2_find_mount_point of the share root '/subdir' failed: No such file or directory
[2017/10/17 18:42:30.595527,  1] ../source3/smbd/service.c:655(make_connection_snum)
  make_connection_snum: SMB_VFS_CONNECT for service 'gluster-xcube-subdir' at '/subdir' failed: No such file or directory

See attached `testparm` output for configured parameters.

Additional info:
Obviously, connecting directly to root of the GlusterFS volume share is not affected as we always mention connect path as "/" and thereby discover mount point based on connect path. But we may not have a local mount point available for the sub-directory share from a GlusterFS volume as it is a virtual file system for Samba.
'shadow:mountpoint' option available with shadow_copy2 vfs module can be used to resolve the issue. So setting 'shadow:mountpoint' to "/" will get around this check for the presence of local sub-directory mount.
Comment 1 Jeremy Allison 2017-10-17 17:02:10 UTC
OK, I'm confused as to what the problem is here and what you need fixing. Can you lay out the issue with specifics as to path and what happens vs. what you expect/need to happen ?

Thanks,

Jeremy.
Comment 2 Anoop C S 2017-10-18 05:42:19 UTC
(In reply to Jeremy Allison from comment #1)

Sorry for any confusions from the bug description. We had this discussed sometime back(around one year back) on samba-technical[1]. I somehow missed to reference this mail thread while creating the bug report. 

[1] https://lists.samba.org/archive/samba-technical/2016-October/116634.html

Based on the `testparam` output provided as the attachment, [gluster-xcube-subdir] is *not* accessible whereas [gluster-xcube] is accessible. The only difference is in parameter 'path' i.e, [gluster-xcube] defines 'path' as "/" and [gluster-xcube-subdir] has path pointing to a sub-directory "/subdir".

# smbclient -U root%smb \\\\<server-ip>\\gluster-xcube
Try "help" to get a list of possible commands.
smb: \>

# smbclient -U root%smb \\\\<server-ip>\\gluster-xcube-subdir
tree connect failed: NT_STATUS_UNSUCCESSFUL   <-- this should work,

see log snippet in c#0 for errors.

After adding 'shadow:mountpoint = /' under [gluster-xcube-subdir]

# smbclient -U root%smb \\\\10.70.43.28\\gluster-xcube-subdir
Try "help" to get a list of possible commands.
smb: \>                                       <-- works

I will try to explain if something more is required apart from the details from upstream discussion.

Adapting bug summary to make it more clear..

Michael,
Do you want to add more here?
Comment 3 Anoop C S 2017-10-23 06:29:47 UTC
Created attachment 13713 [details]
patch for 4.7
Comment 4 Anoop C S 2017-10-23 06:30:34 UTC
Created attachment 13714 [details]
patch for 4.6
Comment 5 Jeremy Allison 2017-10-23 20:57:13 UTC
Comment on attachment 13713 [details]
patch for 4.7

LGTM.
Comment 6 Jeremy Allison 2017-10-23 21:01:40 UTC
Comment on attachment 13714 [details]
patch for 4.6

LGTM.
Comment 7 Guenther Deschner 2017-10-27 06:48:55 UTC
Comment on attachment 13713 [details]
patch for 4.7

LGTM
Comment 8 Guenther Deschner 2017-10-27 06:49:29 UTC
Comment on attachment 13714 [details]
patch for 4.6

LGTM
Comment 9 Guenther Deschner 2017-10-27 06:50:10 UTC
Karolin, please add to 4.7 and 4.6, thanks!
Comment 10 Karolin Seeger 2017-11-01 09:37:04 UTC
(In reply to Guenther Deschner from comment #9)
Pushed to autobuild-v4-{6,7}-test.
Comment 11 Karolin Seeger 2017-11-03 10:02:49 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to both branches.
Closing out bug report.

Thanks!