afr: fix race between __afr_eager_lock_handle and afr_wakeup_same_fd_delayed_op (#4425) #4426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Race between
__afr_eager_lock_handle
andafr_wakeup_same_fd_delayed_op
will lead to stale inodelks, which may cause subsequent IO blocked. To avoid this race, setlock->release = _gf_true
also inafr_wakeup_same_fd_delayed_op
so that a new transaction can be correctly handled as expected in__afr_eager_lock_handle
.Fixes: #4425