From 5bb136c4ca18cc4c058040ea6db312be13edb098 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 11 Jul 2013 14:28:41 +0530 Subject: glusterd: Give up biglock before brick's rpc unref This is to prevent the possibility of a deadlock when rpc_connection_cleanup being called in the same thread as rpc_clnt_unref Change-Id: Ia4dcc0a8a6e6158d4ddec68b780fccbc4cd64adb BUG: 962619 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/5321 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index cb91741e..fea67e77 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1353,6 +1353,7 @@ int32_t glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo) { rpc_clnt_t *rpc = NULL; + glusterd_conf_t *priv = THIS->private; GF_ASSERT (brickinfo); @@ -1364,8 +1365,11 @@ glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo) rpc = brickinfo->rpc; brickinfo->rpc = NULL; - if (rpc) + if (rpc) { + synclock_unlock (&priv->big_lock); rpc_clnt_unref (rpc); + synclock_lock (&priv->big_lock); + } return 0; } -- cgit