From a9187b9609dacb017aff171c317cd5332ef64bd5 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Wed, 20 Oct 2010 01:20:59 +0000 Subject: mgmt/glusterd: resolve the bricks before comparing uuid Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 1985 (peer detach fails if bricks are not resolved) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1985 --- xlators/mgmt/glusterd/src/glusterd-utils.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 8c27036b5e8..7746ec49c23 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1604,6 +1604,7 @@ glusterd_import_friend_volume (dict_t *vols, int count) strcpy (brickinfo->path, path); strcpy (brickinfo->hostname, hostname); + glusterd_resolve_brick (brickinfo); list_add_tail (&brickinfo->brick_list, &volinfo->bricks); @@ -2008,13 +2009,22 @@ int glusterd_friend_brick_belongs (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo, void* uuid) { + int ret = -1; + GF_ASSERT (volinfo); GF_ASSERT (brickinfo); GF_ASSERT (uuid); + if (uuid_is_null (brickinfo->uuid)) { + ret = glusterd_resolve_brick (brickinfo); + if (ret) { + GF_ASSERT (0); + goto out; + } + } if (!uuid_compare (brickinfo->uuid, *((uuid_t *)uuid))) return 0; - +out: return -1; } -- cgit