summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2018-10-04 14:27:45 -0400
committerRaghavendra Bhat <raghavendra@redhat.com>2018-10-04 14:31:58 -0400
commit50ef643281fd1797d9087ff7275c366d67773534 (patch)
tree226c07319ff1ad4569f7b7415e6837a93507b290 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent456537a2a69b88feee75f299dd485811041fc00d (diff)
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/<snap name>/<brick volfile> But in reality, the path to the brick volfile for a snapshot volume is /snaps/<snap name>/<snap volume name>/<brick volfile> 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/<snap name>/<snap volume name>/<brick volfile> 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 <raghavendra@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a1fd62da078..30288e32fe6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2067,10 +2067,10 @@ retry:
}
if (volinfo->is_snap_volume) {
- snprintf (volfile, PATH_MAX,"/%s/%s/%s.%s.%s",
+ snprintf (volfile, PATH_MAX, "/%s/%s/%s/%s.%s.%s",
GLUSTERD_VOL_SNAP_DIR_PREFIX,
volinfo->snapshot->snapname, volinfo->volname,
- brickinfo->hostname, exp_path);
+ volinfo->volname, brickinfo->hostname, exp_path);
} else {
snprintf (volfile, PATH_MAX, "%s.%s.%s", volinfo->volname,
brickinfo->hostname, exp_path);
@@ -5552,10 +5552,11 @@ attach_brick (xlator_t *this,
GLUSTERD_GET_BRICK_PIDFILE (pidfile2, volinfo, brickinfo, conf);
if (volinfo->is_snap_volume) {
- snprintf (full_id, sizeof(full_id), "/%s/%s/%s.%s.%s",
+ snprintf (full_id, sizeof(full_id), "/%s/%s/%s/%s.%s.%s",
GLUSTERD_VOL_SNAP_DIR_PREFIX,
volinfo->snapshot->snapname,
- volinfo->volname, brickinfo->hostname, unslashed);
+ volinfo->volname, volinfo->volname,
+ brickinfo->hostname, unslashed);
} else {
snprintf (full_id, sizeof(full_id), "%s.%s.%s",
volinfo->volname, brickinfo->hostname, unslashed);