diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-07-11 14:28:41 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2013-08-14 01:14:15 -0700 | 
| commit | c1c96e1b5836b7ed1c501cc176da563614e2081e (patch) | |
| tree | 78f81aa01a079ce21c5a430fe58ad3568188756a | |
| parent | a7a9328221419febecea1fc4119005b420c39285 (diff) | |
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 <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/5326
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c4ce931afe3..4c8c98900a9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1500,6 +1500,7 @@ int32_t  glusterd_brick_disconnect (glusterd_brickinfo_t *brickinfo)  {          rpc_clnt_t              *rpc = NULL; +        glusterd_conf_t         *priv = THIS->private;          GF_ASSERT (brickinfo); @@ -1511,8 +1512,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;  }  | 
