From 386031c784537e3877a0797f3fc28f9a221246ae Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 24 Dec 2012 15:17:13 +0530 Subject: glusterd: Set replace-brick id in op ctx only in origin glusterd Change-Id: I8282f911fb47f4cfb45947b2810d84105c82b5ff BUG: 889999 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/4352 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 594825120..b6580a168 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -1621,27 +1621,31 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict) if (ret) goto out; - ctx = glusterd_op_get_ctx(); - if (!ctx) { - gf_log (this->name, GF_LOG_ERROR, "Failed to get op_ctx"); - ret = -1; - goto out; - } if ((GF_REPLACE_OP_START != replace_op)) { /* Set task-id, if available, in op_ctx dict for operations * other than start */ - if (!uuid_is_null (volinfo->rep_brick.rb_id)) { - ret = glusterd_copy_uuid_to_dict - (volinfo->rep_brick.rb_id, ctx, - GF_REPLACE_BRICK_TID_KEY); - if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Failed to set replace-brick-id"); + if (is_origin_glusterd ()) { + ctx = glusterd_op_get_ctx(); + if (!ctx) { + gf_log (this->name, GF_LOG_ERROR, "Failed to " + "get op_ctx"); + ret = -1; goto out; } + if (!uuid_is_null (volinfo->rep_brick.rb_id)) { + ret = glusterd_copy_uuid_to_dict + (volinfo->rep_brick.rb_id, ctx, + GF_REPLACE_BRICK_TID_KEY); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to set " + "replace-brick-id"); + goto out; + } + } } } ret = rb_update_dstbrick_port (dst_brickinfo, rsp_dict, -- cgit