Skip to content

Commit

Permalink
afr: fix race between __afr_eager_lock_handle and afr_wakeup_same_fd_…
Browse files Browse the repository at this point in the history
…delayed_op (#4425) (#4426)

Race between __afr_eager_lock_handle and afr_wakeup_same_fd_delayed_op will lead to
stale inodelks, which may cause subsequent IO blocked.
To avoid this race, set lock->release = _gf_true also in afr_wakeup_same_fd_delayed_op so
that a new transaction can be correctly handled as expected in __afr_eager_lock_handle.

Fixes: #4425

Signed-off-by: chenjinhao <[email protected]>
Co-authored-by: 陈瑾浩 10307298 <[email protected]>
  • Loading branch information
chen1195585098 and 陈瑾浩 10307298 authored Nov 28, 2024
1 parent a360a42 commit 2060330
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xlators/cluster/afr/src/afr-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -4205,6 +4205,7 @@ afr_wakeup_same_fd_delayed_op(xlator_t *this, afr_lock_t *lock, fd_t *fd)
if (gf_timer_call_cancel(this->ctx, lock->delay_timer)) {
local = NULL;
} else {
lock->release = _gf_true;
lock->delay_timer = NULL;
}
} else {
Expand Down

0 comments on commit 2060330

Please sign in to comment.