Skip to content

Commit

Permalink
Merge pull request ceph#53829 from ajarr/wip-63009
Browse files Browse the repository at this point in the history
librbd: kick ExclusiveLock state machine stalled waiting for lock from reacquire_lock()

Reviewed-by: Ilya Dryomov <[email protected]>
  • Loading branch information
idryomov authored Oct 9, 2023
2 parents f9626b5 + 18b0185 commit 425704a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/librbd/ImageWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,6 @@ void ImageWatcher<I>::schedule_request_lock(bool use_timer, int timer_delay) {
} else {
m_task_finisher->queue(TASK_CODE_REQUEST_LOCK, ctx);
}
} else if (is_blocklisted()) {
lderr(m_image_ctx.cct) << this << " blocklisted waiting for exclusive lock"
<< dendl;
m_image_ctx.exclusive_lock->handle_peer_notification(0);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/librbd/ManagedLock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ void ManagedLock<I>::reacquire_lock(Context *on_reacquired) {
{
std::lock_guard locker{m_lock};

if (m_state == STATE_WAITING_FOR_REGISTER) {
if (m_state == STATE_WAITING_FOR_REGISTER ||
m_state == STATE_WAITING_FOR_LOCK) {
// restart the acquire lock process now that watch is valid
ldout(m_cct, 10) << "woke up waiting (re)acquire" << dendl;
Action active_action = get_active_action();
Expand All @@ -217,8 +218,7 @@ void ManagedLock<I>::reacquire_lock(Context *on_reacquired) {
} else if (!is_state_shutdown() &&
(m_state == STATE_LOCKED ||
m_state == STATE_ACQUIRING ||
m_state == STATE_POST_ACQUIRING ||
m_state == STATE_WAITING_FOR_LOCK)) {
m_state == STATE_POST_ACQUIRING)) {
// interlock the lock operation with other state ops
ldout(m_cct, 10) << dendl;
execute_action(ACTION_REACQUIRE_LOCK, on_reacquired);
Expand Down

0 comments on commit 425704a

Please sign in to comment.