7f4c2a
From e0accb86fde62ecc411a497bbdf2cfdf34d4ad65 Mon Sep 17 00:00:00 2001
7f4c2a
From: Avra Sengupta <asengupt@redhat.com>
7f4c2a
Date: Tue, 16 Jun 2015 23:53:32 +0530
7f4c2a
Subject: [PATCH 093/101] snapshot: Fix terminating slash in brick mount path
7f4c2a
7f4c2a
glusterd_find_brick_mount_path(), returns mount path,
7f4c2a
with a terminating '/' at the ned of the string in
7f4c2a
cases where the brick dir is a dir in the lvm root dir.
7f4c2a
7f4c2a
Ignoring the terminating '/' fixes the issue.
7f4c2a
7f4c2a
>Reviewed-on: http://review.gluster.org/11262/
7f4c2a
Change-Id: Ie7e63d37d48e2e03d541ae0076b8f143b8c9112f
7f4c2a
BUG: 1232428
7f4c2a
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/51013
7f4c2a
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
7f4c2a
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
7f4c2a
---
7f4c2a
 tests/bugs/snapshot/bug-1232430.t          |   22 ++++++++++++++++++++++
7f4c2a
 xlators/mgmt/glusterd/src/glusterd-store.c |    1 -
7f4c2a
 2 files changed, 22 insertions(+), 1 deletions(-)
7f4c2a
 create mode 100755 tests/bugs/snapshot/bug-1232430.t
7f4c2a
7f4c2a
diff --git a/tests/bugs/snapshot/bug-1232430.t b/tests/bugs/snapshot/bug-1232430.t
7f4c2a
new file mode 100755
7f4c2a
index 0000000..50411b1
7f4c2a
--- /dev/null
7f4c2a
+++ b/tests/bugs/snapshot/bug-1232430.t
7f4c2a
@@ -0,0 +1,22 @@
7f4c2a
+#!/bin/bash
7f4c2a
+
7f4c2a
+. $(dirname $0)/../../include.rc
7f4c2a
+. $(dirname $0)/../../snapshot.rc
7f4c2a
+
7f4c2a
+cleanup;
7f4c2a
+TEST verify_lvm_version;
7f4c2a
+TEST glusterd -LDEBUG;
7f4c2a
+TEST pidof glusterd;
7f4c2a
+
7f4c2a
+TEST setup_lvm 1
7f4c2a
+
7f4c2a
+TEST $CLI volume create $V0 $H0:$L1/brick_dir
7f4c2a
+TEST $CLI volume start $V0
7f4c2a
+
7f4c2a
+TEST $CLI snapshot create snap1 $V0 no-timestamp
7f4c2a
+
7f4c2a
+TEST $CLI snapshot delete snap1
7f4c2a
+
7f4c2a
+TEST $CLI volume stop $V0 force
7f4c2a
+TEST $CLI volume delete $V0
7f4c2a
+cleanup
7f4c2a
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
7f4c2a
index d790c6f..9e110e5 100644
7f4c2a
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
7f4c2a
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
7f4c2a
@@ -3093,7 +3093,6 @@ glusterd_find_brick_mount_path (char *brick_path, char **brick_mount_path)
7f4c2a
                 ptr++;
7f4c2a
 
7f4c2a
         if (*ptr == '/') {
7f4c2a
-                ptr++;
7f4c2a
                 *ptr = '\0';
7f4c2a
         }
7f4c2a
 
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a