summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2017-09-05 23:58:15 -0400
committerAmar Tumballi <amarts@redhat.com>2017-09-07 09:52:16 +0000
commit84f8fb81d73b87463092eb082a5cc6a4055103f4 (patch)
tree400392bdf9ebbf4c959e4c7f19965600ffb99082 /xlators/mount/fuse
parent6826905213eb7e9bc8728e8269864f066ce0e23a (diff)
mount/fuse: Include sub-directory in source argument for mount()
With this, mount of a sub-directory 'foo' gets listed in /proc/mounts as: <hostname>:<volname>/foo on /mnt/glusterfs type fuse.glusterfs (rw,relatime...) Signed-off-by: Vijay Bellur <vbellur@redhat.com> BUG: 1488913 Change-Id: Ib1e1ac3741bf66e1a912d792f2948b748931f2b0 Reviewed-on: https://review.gluster.org/18210 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index f9df3586c44..4865ffdc562 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -5684,9 +5684,13 @@ init (xlator_t *this_xl)
fsname = cmd_args->volfile;
if (!fsname && cmd_args->volfile_server) {
if (cmd_args->volfile_id) {
+ int dir_len = 0;
+ if (cmd_args->subdir_mount)
+ dir_len = strlen (cmd_args->subdir_mount) + 1;
fsname = GF_MALLOC (
strlen (cmd_args->volfile_server) + 1 +
- strlen (cmd_args->volfile_id) + 1,
+ strlen (cmd_args->volfile_id) + 1 +
+ dir_len,
gf_fuse_mt_fuse_private_t);
if (!fsname) {
gf_log ("glusterfs-fuse", GF_LOG_ERROR,
@@ -5697,6 +5701,8 @@ init (xlator_t *this_xl)
strcpy (fsname, cmd_args->volfile_server);
strcat (fsname, ":");
strcat (fsname, cmd_args->volfile_id);
+ if (dir_len)
+ strcat (fsname, cmd_args->subdir_mount);
} else
fsname = cmd_args->volfile_server;
}