From 50ef643281fd1797d9087ff7275c366d67773534 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 4 Oct 2018 14:27:45 -0400 Subject: mgmt/glusterd: use proper path to the volfile Till now, glusterd was generating the volfile path for the snapshot volume's bricks like this. /snaps// But in reality, the path to the brick volfile for a snapshot volume is /snaps/// The above workaround was used to distinguish between a mount command used to mount the snapshot volume, and a brick of the snapshot volume, so that based on what is actually happening, glusterd can return the proper volfile (client volfile for the former and the brick volfile for the latter). But, this was causing problems for snapshot restore when brick multiplexing is enabled. Because, with brick multiplexing, it tries to find the volfile and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e. /snaps/// So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc request to glusterd for obtaining the brick volume file, glusterd was returning the client volume file of the snapshot volume instead of the brick volume file. Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e fixes: bz#1636218 Signed-off-by: Raghavendra Bhat --- xlators/features/snapview-server/src/snapview-server-helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/snapview-server/src/snapview-server-helpers.c b/xlators/features/snapview-server/src/snapview-server-helpers.c index 6f305dbc2fb..e7025b70cc6 100644 --- a/xlators/features/snapview-server/src/snapview-server-helpers.c +++ b/xlators/features/snapview-server/src/snapview-server-helpers.c @@ -461,8 +461,9 @@ __svs_initialise_snapshot_volume (xlator_t *this, const char *name, goto out; } - snprintf (volname, sizeof (volname), "/snaps/%s/%s", - dirent->name, dirent->snap_volname); + snprintf (volname, sizeof (volname), "/snaps/%s/%s/%s", + dirent->name, dirent->snap_volname, + dirent->snap_volname); fs = glfs_new (volname); -- cgit