diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 16 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.h | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 15 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 6 |
5 files changed, 21 insertions, 20 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 3c51879d9..f39de3116 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -4368,7 +4368,8 @@ out: static int glusterd_bricks_select_heal_volume (dict_t *dict, char **op_errstr, - struct list_head *selected) + struct list_head *selected, + dict_t *rsp_dict) { int ret = -1; char *volname = NULL; @@ -4379,7 +4380,6 @@ glusterd_bricks_select_heal_volume (dict_t *dict, char **op_errstr, glusterd_pending_node_t *pending_node = NULL; gf_xl_afr_op_t heal_op = GF_AFR_OP_INVALID; int rxlator_count = 0; - dict_t *op_ctx = NULL; this = THIS; GF_ASSERT (this); @@ -4412,9 +4412,13 @@ glusterd_bricks_select_heal_volume (dict_t *dict, char **op_errstr, if (!glusterd_is_nodesvc_online ("glustershd") && (heal_op == GF_AFR_OP_INDEX_SUMMARY)) { - op_ctx = glusterd_op_get_ctx (); + if (!rsp_dict) { + gf_log (this->name, GF_LOG_ERROR, "Received empty " + "ctx."); + goto out; + } - ret = fill_shd_status_for_local_bricks (op_ctx, volinfo); + ret = fill_shd_status_for_local_bricks (rsp_dict, volinfo); if (ret) gf_log (this->name, GF_LOG_ERROR, "Unable to fill the shd" " status for the local bricks"); @@ -4764,7 +4768,7 @@ out: int32_t glusterd_op_bricks_select (glusterd_op_t op, dict_t *dict, char **op_errstr, - struct list_head *selected) + struct list_head *selected, dict_t *rsp_dict) { int ret = 0; @@ -4791,7 +4795,7 @@ glusterd_op_bricks_select (glusterd_op_t op, dict_t *dict, char **op_errstr, case GD_OP_HEAL_VOLUME: ret = glusterd_bricks_select_heal_volume (dict, op_errstr, - selected); + selected, rsp_dict); break; case GD_OP_STATUS_VOLUME: diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h index 21493bbd9..df8b8c141 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h @@ -234,7 +234,7 @@ char* glusterd_op_sm_event_name_get (int event); int32_t glusterd_op_bricks_select (glusterd_op_t op, dict_t *dict, char **op_errstr, - struct list_head *selected); + struct list_head *selected, dict_t *rsp_dict); int glusterd_brick_op_build_payload (glusterd_op_t op, glusterd_brickinfo_t *brickinfo, gd1_mgmt_brick_op_req **req, dict_t *dict); diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index c0de195bd..124972857 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -1403,7 +1403,7 @@ glusterd_brick_op (call_frame_t *frame, xlator_t *this, GF_ASSERT (req_ctx); INIT_LIST_HEAD (&opinfo.pending_bricks); ret = glusterd_op_bricks_select (req_ctx->op, req_ctx->dict, &op_errstr, - &opinfo.pending_bricks); + &opinfo.pending_bricks, NULL); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Failed to select bricks " diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 7aa9ea9ff..37839a9e3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -754,8 +754,15 @@ stage_done: } /*brick op */ + rsp_dict = dict_new (); + if (!rsp_dict) { + ret = -1; + goto out; + } + INIT_LIST_HEAD (&selected); - ret = glusterd_op_bricks_select (op, req_dict, &op_errstr, &selected); + ret = glusterd_op_bricks_select (op, req_dict, &op_errstr, + &selected, rsp_dict); if (ret) { gf_log (this->name, GF_LOG_ERROR, "%s", (op_errstr)? op_errstr: "Brick op failed. Check " @@ -791,12 +798,6 @@ stage_done: brick_count); /* commit op */ - rsp_dict = dict_new (); - if (!rsp_dict) { - ret = -1; - goto out; - } - ret = glusterd_op_commit_perform (op, req_dict, &op_errstr, rsp_dict); if (ret) { hostname = "localhost"; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index fb1832f0d..ac8925e54 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -461,13 +461,9 @@ glusterd_handle_cli_heal_volume (rpcsvc_request_t *req) if (ret) goto out; - ret = glusterd_op_begin (req, GD_OP_HEAL_VOLUME, dict, - op_errstr, sizeof (op_errstr)); + ret = glusterd_op_begin_synctask (req, GD_OP_HEAL_VOLUME, dict); out: - glusterd_friend_sm (); - glusterd_op_sm (); - if (ret) { if (op_errstr[0] == '\0') snprintf (op_errstr, sizeof (op_errstr), |