summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 71f23a8f139..d1d45a75c9c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -651,6 +651,7 @@ glusterd_brickinfo_get (char *brick, glusterd_volinfo_t *volinfo,
char *dup_brick = NULL;
char *free_ptr = NULL;
glusterd_brickinfo_t *tmp = NULL;
+ uuid_t uuid = {0};
GF_ASSERT (brick);
GF_ASSERT (brickinfo);
@@ -679,18 +680,20 @@ glusterd_brickinfo_get (char *brick, glusterd_volinfo_t *volinfo,
goto out;
}
+ ret = glusterd_hostname_to_uuid (hostname, uuid);
+ if (ret)
+ goto out;
list_for_each_entry (tmp, &volinfo->bricks, brick_list) {
- if ((!strcmp (tmp->hostname, hostname)) &&
+ if ((!uuid_compare (uuid, tmp->uuid)) &&
!strcmp (tmp->path, path)) {
gf_log ("", GF_LOG_NORMAL, "Found brick");
ret = 0;
+ *brickinfo = tmp;
break;
}
}
- *brickinfo = tmp;
-
out:
if (free_ptr)
GF_FREE (free_ptr);