diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-07-15 06:16:54 +0530 |
---|---|---|
committer | Xavier Hernandez <xhernandez@datalab.es> | 2015-07-23 09:36:46 -0700 |
commit | 75d50eaba3fd7d24874ba8acc9a776c863a932e2 (patch) | |
tree | 84bbb2ca0391034b037c9349af294b4060cbc0f9 /xlators/cluster/ec/src/ec-common.h | |
parent | 2815a8c778fb6c17c6dfe908a82e840687c29a98 (diff) |
cluster/ec: Handle race between unlock-timer, new lock
Problem:
New lock could come at the time timer is on the way to unlock. This was leading
to crash in timer thread because thread executing new lock can free up the
timer_link->fop and then timer thread will try to access structures already
freed.
Fix:
If the timer event is fired, set lock->release to true and wait for unlock to
complete.
Thanks to Xavi and Bhaskar for helping in confirming that this race is the RC.
Thanks to Kritika for pointing out and explaining how Avati's patch can be used
to fix this bug.
> Change-Id: I45fa5470bbc1f03b5f3d133e26d1e0ab24303378
> BUG: 1243187
> Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
> Reviewed-on: http://review.gluster.org/11670
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Change-Id: I9af012e717493684b7cd7d1c63baf2fa401fb542
BUG: 1246121
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11752
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Diffstat (limited to 'xlators/cluster/ec/src/ec-common.h')
-rw-r--r-- | xlators/cluster/ec/src/ec-common.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h index 1d78f132a94..41e10e2f16f 100644 --- a/xlators/cluster/ec/src/ec-common.h +++ b/xlators/cluster/ec/src/ec-common.h @@ -91,7 +91,6 @@ void ec_lock_prepare_fd(ec_fop_data_t *fop, fd_t *fd, uint32_t flags); void ec_lock(ec_fop_data_t * fop); void ec_lock_reuse(ec_fop_data_t *fop); void ec_unlock(ec_fop_data_t * fop); -void ec_unlock_force(ec_fop_data_t *fop); gf_boolean_t ec_get_inode_size(ec_fop_data_t *fop, inode_t *inode, uint64_t *size); |