From 0b68f788a8ff0579f70e546bcd365ee0c3a49a12 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Fri, 24 Sep 2010 13:37:32 +0000 Subject: mgmt/glusterd: resolve brick before doing uuid compare Signed-off-by: Vijay Bellur Signed-off-by: Vijay Bellur BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 3b6a0201670..2361976819b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2939,6 +2939,8 @@ glusterd_op_log_filename (gd1_mgmt_stage_op_req *req) char logfile[PATH_MAX] = {0,}; char exp_path[PATH_MAX] = {0,}; struct stat stbuf = {0,}; + char *brick_path = NULL; + GF_ASSERT (req); @@ -2989,9 +2991,21 @@ glusterd_op_log_filename (gd1_mgmt_stage_op_req *req) goto out; list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { + + if (uuid_is_null (brickinfo->uuid)) { + ret = glusterd_resolve_brick (brickinfo); + } + if (uuid_compare (brickinfo->uuid, priv->uuid)) continue; + brick_path = strchr (brick, ':'); + brick_path++; + + if (brick_path && strcmp (brickinfo->path, brick_path)) + continue; + + GLUSTERD_REMOVE_SLASH_FROM_PATH (brickinfo->path, exp_path); if (brick && strcmp (brickinfo->path, brick)) continue; -- cgit