Blob Blame History Raw
From e0accb86fde62ecc411a497bbdf2cfdf34d4ad65 Mon Sep 17 00:00:00 2001
From: Avra Sengupta <asengupt@redhat.com>
Date: Tue, 16 Jun 2015 23:53:32 +0530
Subject: [PATCH 093/101] snapshot: Fix terminating slash in brick mount path

glusterd_find_brick_mount_path(), returns mount path,
with a terminating '/' at the ned of the string in
cases where the brick dir is a dir in the lvm root dir.

Ignoring the terminating '/' fixes the issue.

>Reviewed-on: http://review.gluster.org/11262/
Change-Id: Ie7e63d37d48e2e03d541ae0076b8f143b8c9112f
BUG: 1232428
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/51013
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
---
 tests/bugs/snapshot/bug-1232430.t          |   22 ++++++++++++++++++++++
 xlators/mgmt/glusterd/src/glusterd-store.c |    1 -
 2 files changed, 22 insertions(+), 1 deletions(-)
 create mode 100755 tests/bugs/snapshot/bug-1232430.t

diff --git a/tests/bugs/snapshot/bug-1232430.t b/tests/bugs/snapshot/bug-1232430.t
new file mode 100755
index 0000000..50411b1
--- /dev/null
+++ b/tests/bugs/snapshot/bug-1232430.t
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../snapshot.rc
+
+cleanup;
+TEST verify_lvm_version;
+TEST glusterd -LDEBUG;
+TEST pidof glusterd;
+
+TEST setup_lvm 1
+
+TEST $CLI volume create $V0 $H0:$L1/brick_dir
+TEST $CLI volume start $V0
+
+TEST $CLI snapshot create snap1 $V0 no-timestamp
+
+TEST $CLI snapshot delete snap1
+
+TEST $CLI volume stop $V0 force
+TEST $CLI volume delete $V0
+cleanup
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index d790c6f..9e110e5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -3093,7 +3093,6 @@ glusterd_find_brick_mount_path (char *brick_path, char **brick_mount_path)
                 ptr++;
 
         if (*ptr == '/') {
-                ptr++;
                 *ptr = '\0';
         }
 
-- 
1.7.1