diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-05-21 17:15:07 +0530 |
---|---|---|
committer | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-05-21 18:27:39 +0530 |
commit | 43ade7abac6c1d648ef337ace92194d36c8894a4 (patch) | |
tree | 11b797cb5991bee09641ea5c1e6b8ef34f0a6cf6 /xlators/cluster/ec/src/ec.c | |
parent | 72a83c71cc506e3a4d775b622717052c93f5242f (diff) |
ec/fini: Fix race with ec_fini and ec_notify
During a graph cleanup, we first sent a PARENT_DOWN and wait for
a child down to ultimately free the xlator and the graph.
In the ec xlator, we cleanup the threads when we get a PARENT_DOWN event.
But a racing event like CHILD_UP or event xl_op may trigger healing threads
after threads cleanup.
So there is a chance that the threads might access a freed private variabe
Change-Id: I252d10181bb67b95900c903d479de707a8489532
fixes: bz#1703948
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec.c')
-rw-r--r-- | xlators/cluster/ec/src/ec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index 4e9fac5ea39..95100951220 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -486,6 +486,9 @@ ec_set_up_state(ec_t *ec, uintptr_t index_mask, uintptr_t new_state) { uintptr_t current_state = 0; + if (xlator_is_cleanup_starting(ec->xl)) + return _gf_false; + if ((ec->xl_notify & index_mask) == 0) { ec->xl_notify |= index_mask; ec->xl_notify_count++; |