a3470f
From b5f16e56bd1a9e64fa461f22f24790992fd2c008 Mon Sep 17 00:00:00 2001
a3470f
From: Mohammed Rafi KC <rkavunga@redhat.com>
a3470f
Date: Thu, 12 Oct 2017 14:31:14 +0530
a3470f
Subject: [PATCH 36/74] mount/fuse : Fix parsing of vol_id for snapshot volume
a3470f
a3470f
For supporting sub-dir mount, we changed the volid. Which means anything
a3470f
after a '/' in volume_id will be considered as sub-dir path.
a3470f
a3470f
But snapshot volume has vol_id stracture of /snaps/<volname>/<snapname>
a3470f
which has to be considered as during the parsing.
a3470f
a3470f
Note 1: sub-dir mount is not supported on snapshot volume
a3470f
Note 2: With sub-dir mount changes brick based mount for quota cannot be
a3470f
        executed via mount command. It has to be a direct call via glusterfs
a3470f
a3470f
Backport of>
a3470f
>Change-Id: I0d824de0236b803db8a918f683dabb0cb523cb04
a3470f
>BUG: 1501235
a3470f
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
a3470f
>Upstream patch : https://review.gluster.org/18506
a3470f
a3470f
Change-Id: I82903bdd0bfcf8454faef958b38f13d4d95a2346
a3470f
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/120524
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/mount/fuse/utils/mount.glusterfs.in | 6 ++++--
a3470f
 1 file changed, 4 insertions(+), 2 deletions(-)
a3470f
a3470f
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
a3470f
index bd6503a..36b60ff 100755
a3470f
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
a3470f
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
a3470f
@@ -675,8 +675,10 @@ main ()
a3470f
             [ ${first_char} = '/' ] && {
a3470f
                 volume_str_temp=$(echo "$volume_str" | cut -c 2-)
a3470f
             }
a3470f
-            [ $(echo $volume_str_temp | grep -c "/") -eq 1 ] && {
a3470f
-                volume_id=$(echo "$volume_str_temp" | cut -f1 -d '/');
a3470f
+            volume_id_temp=$(echo "$volume_str_temp" | cut -f1 -d '/');
a3470f
+            [ $(echo $volume_str_temp | grep -c "/") -eq 1 ] &&
a3470f
+                    [ "$volume_id_temp" != "snaps" ]  && {
a3470f
+                volume_id=$volume_id_temp;
a3470f
                 subdir_mount=$(echo "$volume_str_temp" | cut -f2- -d '/');
a3470f
             }
a3470f
         }
a3470f
-- 
a3470f
1.8.3.1
a3470f