diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-08-28 17:29:53 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-30 03:29:51 -0700 |
commit | 50cb2c23e8e7bd1173572a21990dbdf545f09141 (patch) | |
tree | 036ea4cc2188d4e916e4e3d59f864b390855493b | |
parent | 84298d77060772b91123d9cde9f0e6e4d9efc9ca (diff) |
glusterd: Fixed incorrect assumptions in rpcsvc actors of glusterd
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3864
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Conflicts:
xlators/mgmt/glusterd/src/glusterd-handler.c
Change-Id: Iabfcb401de9d658e32433aa1e8c87b329cbd2cf7
BUG: 851109
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3876
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 41 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 5 |
2 files changed, 27 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 2e50b1c0e7d..f5992339511 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -644,10 +644,11 @@ glusterd_handle_commit_op (rpcsvc_request_t *req) if (ret) goto out; - ret = glusterd_op_sm_inject_event (GD_OP_EVENT_COMMIT_OP, req_ctx); + ret = glusterd_op_init_ctx (op_req.op); if (ret) goto out; - ret = glusterd_op_init_ctx (op_req.op); + + ret = glusterd_op_sm_inject_event (GD_OP_EVENT_COMMIT_OP, req_ctx); out: if (op_req.buf.buf_val) @@ -941,8 +942,9 @@ out: else rsp.op_errstr = ""; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, (xdrproc_t)xdr_gf_cli_rsp); + ret = 0; if (dict) dict_unref (dict); @@ -1783,8 +1785,9 @@ glusterd_handle_probe_query (rpcsvc_request_t *req) */ rsp.op_errstr = ""; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gd1_mgmt_probe_rsp); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gd1_mgmt_probe_rsp); + ret = 0; gf_log ("glusterd", GF_LOG_INFO, "Responded to %s, op_ret: %d, " "op_errno: %d, ret: %d", remote_hostname, @@ -1878,8 +1881,9 @@ glusterd_handle_getwd (rpcsvc_request_t *req) rsp.wd = priv->workdir; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gf1_cli_getwd_rsp); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gf1_cli_getwd_rsp); + ret = 0; glusterd_friend_sm (); glusterd_op_sm (); @@ -1934,8 +1938,9 @@ glusterd_handle_mount (rpcsvc_request_t *req) if (!rsp.path) rsp.path = ""; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gf1_cli_mount_rsp); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gf1_cli_mount_rsp); + ret = 0; if (dict) dict_unref (dict); @@ -2023,8 +2028,9 @@ glusterd_handle_umount (rpcsvc_request_t *req) if (rsp.op_errno) rsp.op_ret = -1; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gf1_cli_umount_rsp); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gf1_cli_umount_rsp); + ret = 0; glusterd_friend_sm (); glusterd_op_sm (); @@ -2494,10 +2500,10 @@ out: rsp.op_ret = ret; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gf1_cli_peer_list_rsp); - if (rsp.friends.friends_val) - GF_FREE (rsp.friends.friends_val); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gf1_cli_peer_list_rsp); + ret = 0; + GF_FREE (rsp.friends.friends_val); return ret; } @@ -2598,8 +2604,9 @@ out: rsp.op_ret = ret; rsp.op_errstr = ""; - ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gf_cli_rsp); + glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gf_cli_rsp); + ret = 0; if (volumes) dict_unref (volumes); diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index f47b5b70db3..f1d6aa30782 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -182,8 +182,9 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret, cli_rsp = &rsp; xdrproc = (xdrproc_t) xdr_gf_cli_rsp; - ret = glusterd_submit_reply (req, cli_rsp, NULL, 0, NULL, - xdrproc); + glusterd_submit_reply (req, cli_rsp, NULL, 0, NULL, + xdrproc); + ret = 0; if (free_ptr) GF_FREE (free_ptr); |