summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-04-17 08:39:30 -0400
committerRaghavendra Talur <rtalur@redhat.com>2017-04-27 10:45:01 +0000
commit6cd1f12ae58f1cace89104664a6d41b682b7ee88 (patch)
treed7d29ee403419a6405fa742f84215e3502974c3e /xlators
parent04730eda1794d89e1cc186c16a504e4586196988 (diff)
glusterd: Fix snapshot failure in non-root geo-rep setup
Geo-replication session directory name has the form '<mastervol>_<slavehost>_<slavevol>'. But in non-root geo-replication setup, while preparing geo-replication session directory name, glusterd is including 'user@' resulting in "<mastervol>_<user@slavehost>_<slavevol>". Hence snapshot is failing to copy geo-rep specific session files. Fixing the same. > BUG: 1442760 > Signed-off-by: Kotresh HR <khiremat@redhat.com> > Reviewed-on: https://review.gluster.org/17067 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Amar Tumballi <amarts@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit cc839523364e47dea715cd7241772cd68f05f76c) Change-Id: Id214d3186e40997d2827a0bb60d3676ca2552df7 BUG: 1443010 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/17070 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
index c8af1ec21c4..21fd6e7c3b8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
@@ -3501,6 +3501,7 @@ glusterd_get_geo_rep_session (char *slave_key, char *origin_volname,
char *slave)
{
int32_t ret = -1;
+ int32_t len = 0;
char *token = NULL;
char *tok = NULL;
char *temp = NULL;
@@ -3569,8 +3570,10 @@ glusterd_get_geo_rep_session (char *slave_key, char *origin_volname,
* 'root@' */
ip_temp = gf_strdup (ip);
tok = strtok_r (ip_temp, "@", &save_ptr);
- if (tok && !strcmp (tok, "root"))
- ip_i = ip + 5;
+ len = strlen(tok);
+ tok = strtok_r (NULL, "@", &save_ptr);
+ if (tok != NULL)
+ ip_i = ip + len + 1;
ret = snprintf (session, PATH_MAX, "%s_%s_%s",
origin_volname, ip_i, slave_temp);