diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-05-07 15:27:08 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-05-07 21:49:17 -0700 |
commit | 8923c14151d646ab90f05addc9e6c3ed178fee10 (patch) | |
tree | 088b7a002efd6e352767a4f72d0bc06b342a466b /xlators/mgmt/glusterd/src/glusterd-syncop.c | |
parent | d4557824a64e1eb5aa2ee5dece237a5e9bb8eac8 (diff) |
glusterd: Give up big lock before performing any RPC
Change-Id: Ib0a772dc1cb9afc8adccd8f7092f480d2b525ea0
BUG: 960580
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4964
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index d8136ab8231..79b45a2b81a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -255,12 +255,15 @@ gd_syncop_mgmt_lock (struct rpc_clnt *rpc, struct syncargs *args, { int ret = -1; gd1_mgmt_cluster_lock_req req = {{0},}; + glusterd_conf_t *conf = THIS->private; uuid_copy (req.uuid, my_uuid); + synclock_unlock (&conf->big_lock); ret = gd_syncop_submit_request (rpc, &req, args, &gd_mgmt_prog, GLUSTERD_MGMT_CLUSTER_LOCK, gd_syncop_mgmt_lock_cbk, (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req); + synclock_lock (&conf->big_lock); return ret; } @@ -311,12 +314,15 @@ gd_syncop_mgmt_unlock (struct rpc_clnt *rpc, struct syncargs *args, { int ret = -1; gd1_mgmt_cluster_unlock_req req = {{0},}; + glusterd_conf_t *conf = THIS->private; uuid_copy (req.uuid, my_uuid); + synclock_unlock (&conf->big_lock); ret = gd_syncop_submit_request (rpc, &req, args, &gd_mgmt_prog, GLUSTERD_MGMT_CLUSTER_UNLOCK, gd_syncop_mgmt_unlock_cbk, (xdrproc_t) xdr_gd1_mgmt_cluster_lock_req); + synclock_lock (&conf->big_lock); return ret; } @@ -401,7 +407,8 @@ gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, struct syncargs *args, dict_t *dict_out, dict_t *op_ctx) { gd1_mgmt_stage_op_req *req = NULL; - int ret = -1; + glusterd_conf_t *conf = THIS->private; + int ret = -1; req = GF_CALLOC (1, sizeof (*req), gf_gld_mt_mop_stage_req_t); if (!req) @@ -415,10 +422,12 @@ gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, struct syncargs *args, if (ret) goto out; + synclock_unlock (&conf->big_lock); ret = gd_syncop_submit_request (rpc, req, args, &gd_mgmt_prog, GLUSTERD_MGMT_STAGE_OP, gd_syncop_stage_op_cbk, (xdrproc_t) xdr_gd1_mgmt_stage_op_req); + synclock_lock (&conf->big_lock); out: gd_stage_op_req_free (req); return ret; @@ -630,6 +639,7 @@ gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, struct syncargs *args, uuid_t my_uuid, uuid_t recv_uuid, int op, dict_t *dict_out, dict_t *op_ctx) { + glusterd_conf_t *conf = THIS->private; gd1_mgmt_commit_op_req *req = NULL; int ret = -1; @@ -645,10 +655,12 @@ gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, struct syncargs *args, if (ret) goto out; + synclock_unlock (&conf->big_lock); ret = gd_syncop_submit_request (rpc, req, args, &gd_mgmt_prog, GLUSTERD_MGMT_COMMIT_OP , gd_syncop_commit_op_cbk, (xdrproc_t) xdr_gd1_mgmt_commit_op_req); + synclock_lock (&conf->big_lock); out: gd_commit_op_req_free (req); return ret; |