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