summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2017-09-05 23:58:15 -0400
committerVijay Bellur <vbellur@redhat.com>2017-09-11 18:23:18 +0000
commit68944b104952751b5bd551fe1d84a6bb20962484 (patch)
tree689fda6c38c6b47207e626d1ee6f07cd52570e7b
parent02d9b26502839d1439132925b72d03b2b6306482 (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: 1490493 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> (cherry picked from commit 84f8fb81d73b87463092eb082a5cc6a4055103f4)
-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;
}