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