diff options
| author | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-06-02 01:36:33 +0530 |
|---|---|---|
| committer | Pranith Kumar K <pkarampu@redhat.com> | 2019-06-08 17:50:10 +0530 |
| commit | 4cfc5788af2488d173ac033850370c4f9ed7a05e (patch) | |
| tree | 98a97731e3c76fca7c6f6c06dd2622fe3228adbe /xlators/cluster/ec/src/ec-data.c | |
| parent | 9e0de2b634b888dd069e908b7745197d20fe7036 (diff) | |
ec/fini: Fix race between xlator cleanup and on going async fop
Problem:
While we process a cleanup, there is a chance for a race between
async operations, for example ec_launch_replace_heal. So this can
lead to invalid mem access.
Solution:
Just like we track on going heal fops, we can also track fops like
ec_launch_replace_heal, so that we can decide when to send a
PARENT_DOWN request.
Change-Id: I055391c5c6c34d58aef7336847f3b570cb831298
fixes: bz#1703948
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-data.c')
| -rw-r--r-- | xlators/cluster/ec/src/ec-data.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec-data.c b/xlators/cluster/ec/src/ec-data.c index 6ef934080a9..8d2d9a1dfa2 100644 --- a/xlators/cluster/ec/src/ec-data.c +++ b/xlators/cluster/ec/src/ec-data.c @@ -202,11 +202,13 @@ ec_handle_last_pending_fop_completion(ec_fop_data_t *fop, gf_boolean_t *notify) { ec_t *ec = fop->xl->private; + *notify = _gf_false; + if (!list_empty(&fop->pending_list)) { LOCK(&ec->lock); { list_del_init(&fop->pending_list); - *notify = list_empty(&ec->pending_fops); + *notify = __ec_is_last_fop(ec); } UNLOCK(&ec->lock); } |
