From ada6b3a8800867934af57a57d5312f5a5d8374f0 Mon Sep 17 00:00:00 2001 From: anand Date: Fri, 17 Apr 2015 14:19:46 +0530 Subject: libglusterfs: Implementation of sync lock as recursive lock to avoid crash. Problem : In glusterd,we are using big lock which is implemented based on sync task frame work for thread synchronization and rcu lock for data consistency. sync task frame work swap the threads if there is no worker poll threads available,due to this rcu lock and rcu unlock was happening in different threads (urcu-bp will not allow this),resulting into glusterd crash. fix : To avoid releasing the sync lock(big lock) in between rcu critical section,implemented sync lock as recursive lock. More details: link : http://www.spinics.net/lists/gluster-devel/msg14632.html Change-Id: I2b56c1caf3f0470f219b1adcaf62cce29cdc6b88 BUG: 1211640 Signed-off-by: anand Reviewed-on: http://review.gluster.org/10285 Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-mgmt.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c index e07d4100d00..539efb5900d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c @@ -378,14 +378,11 @@ gd_mgmt_v3_lock (glusterd_op_t op, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_LOCK, gd_mgmt_v3_lock_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_lock_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); @@ -653,14 +650,11 @@ gd_mgmt_v3_pre_validate_req (glusterd_op_t op, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_PRE_VALIDATE, gd_mgmt_v3_pre_validate_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_pre_val_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); @@ -911,14 +905,11 @@ gd_mgmt_v3_brick_op_req (glusterd_op_t op, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_BRICK_OP, gd_mgmt_v3_brick_op_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_brick_op_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); @@ -1154,14 +1145,11 @@ gd_mgmt_v3_commit_req (glusterd_op_t op, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_COMMIT, gd_mgmt_v3_commit_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_commit_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); @@ -1376,14 +1364,11 @@ gd_mgmt_v3_post_validate_req (glusterd_op_t op, int32_t op_ret, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_POST_VALIDATE, gd_mgmt_v3_post_validate_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_post_val_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); @@ -1588,14 +1573,11 @@ gd_mgmt_v3_unlock (glusterd_op_t op, dict_t *op_ctx, gf_uuid_copy (peerid, peerinfo->uuid); - synclock_unlock (&conf->big_lock); - ret = gd_syncop_submit_request (peerinfo->rpc, &req, args, &peerid, &gd_mgmt_v3_prog, GLUSTERD_MGMT_V3_UNLOCK, gd_mgmt_v3_unlock_cbk, (xdrproc_t) xdr_gd1_mgmt_v3_unlock_req); - synclock_lock (&conf->big_lock); out: GF_FREE (req.dict.dict_val); gf_log (this->name, GF_LOG_TRACE, "Returning %d", ret); -- cgit