diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2017-02-17 09:42:46 -0500 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-03-10 14:48:34 -0500 |
commit | 4ee59efe3826745a5359bd36e79957d3b78ec4ba (patch) | |
tree | 66a101660406cddef24e0060a89f2fd23614a9a8 /xlators/mgmt/glusterd | |
parent | 0c05761bcffaddaadfdd9f954609a9323ce87b24 (diff) |
glusterd: take conn->lock around operations on conn->reconnect
Failure to do this could lead to a race in which a timer would be
removed twice concurrently, corrupting the timer list (because
gf_timer_call_cancel has no internal protection against this) and
possibly causing a crash.
Backport of:
> 4e0d4b15717da1f6466133158a26927fb91384b8
> BUG: 1421721
> Reviewed-on: https://review.gluster.org/16662
Change-Id: Ic1a8b612d436daec88fd6cee935db0ae81a47d5c
BUG: 1431175
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: https://review.gluster.org/16885
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b6f001a8901..c501e1ad00b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1875,10 +1875,11 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, if (rpc) { brickinfo->rpc = NULL; conn = &rpc->conn; + pthread_mutex_lock (&conn->lock); if (conn->reconnect) { (void ) gf_timer_call_cancel (rpc->ctx, conn->reconnect); - //rpc_clnt_unref (rpc); } + pthread_mutex_unlock (&conn->lock); rpc_clnt_unref (rpc); } |