diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-06-20 20:43:24 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-06-24 05:01:44 +0000 |
commit | 665d627e865d8cfa6a454c2c79eed9e9a1276865 (patch) | |
tree | 1d7402b71691de65cff725f769244d5d5cc0f03e /xlators/mgmt/glusterd | |
parent | e2f2f414f855f9a3da269745ae3db2d27baa7f3d (diff) |
shd/mux: Fix race between mux_proc unlink and stop
There is a small race window, where we have a shd proc
without having a connection. That is when we stopped the
last shd running on a process. The list was removed
outside of a lock just after stopping the process.
So there is a window where we stopped the process, but
the shd proc list contains the entry.
Change-Id: Id82a82509e5cd72acac24e8b7b87197626525441
fixes: bz#1722541
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c index ebf7e3a8e6b..f6999e3ec4c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c +++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c @@ -696,6 +696,9 @@ glusterd_shdsvc_stop(glusterd_svc_t *svc, int sig) } cds_list_del_init(&svc->mux_svc); empty = cds_list_empty(&svc_proc->svcs); + if (empty) { + cds_list_del_init(&svc_proc->svc_proc_list); + } } pthread_mutex_unlock(&conf->attach_lock); if (empty) { |