summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2018-10-01 17:30:19 -0400
committerAtin Mukherjee <amukherj@redhat.com>2018-10-04 05:02:35 +0000
commit83a89296a3d12a3fc2a643c0630be5ce659204ea (patch)
tree27ecd5d9c86bed30d67ffc31454f40d8a8a50424 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent6b58e8426a36bc544c06a599311999bf89ad04f2 (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#1635050 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 9b9e6f88f0b..757560e68d1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2131,10 +2131,10 @@ retry:
}
if (volinfo->is_snap_volume) {
- len = snprintf(volfile, PATH_MAX, "/%s/%s/%s.%s.%s",
+ len = 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 {
len = snprintf(volfile, PATH_MAX, "%s.%s.%s", volinfo->volname,
brickinfo->hostname, exp_path);
@@ -5659,10 +5659,10 @@ attach_brick(xlator_t *this, glusterd_brickinfo_t *brickinfo,
GLUSTERD_GET_BRICK_PIDFILE(pidfile2, volinfo, brickinfo, conf);
if (volinfo->is_snap_volume) {
- len = snprintf(full_id, sizeof(full_id), "/%s/%s/%s.%s.%s",
+ len = 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, brickinfo->hostname, unslashed);
} else {
len = snprintf(full_id, sizeof(full_id), "%s.%s.%s", volinfo->volname,
brickinfo->hostname, unslashed);