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