Commit db0f6ce69776370232431eb8be85a5b18b0019c0

Authored by Sunil Mushran
Committed by Joel Becker
1 parent 0d74125a6a

ocfs2: Remove overzealous BUG_ON during blocked lock processing

During blocked lock processing, we should consider the possibility that the
lock is no longer blocking.

Joel Becker <joel.becker@oracle.com> assisted in fixing this issue.

Reported-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>

Showing 1 changed file with 10 additions and 2 deletions Side-by-side Diff

... ... @@ -3392,9 +3392,17 @@
3392 3392  
3393 3393 spin_lock_irqsave(&lockres->l_lock, flags);
3394 3394  
3395   - BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
3396   -
3397 3395 recheck:
  3396 + /*
  3397 + * Is it still blocking? If not, we have no more work to do.
  3398 + */
  3399 + if (!(lockres->l_flags & OCFS2_LOCK_BLOCKED)) {
  3400 + BUG_ON(lockres->l_blocking != DLM_LOCK_NL);
  3401 + spin_unlock_irqrestore(&lockres->l_lock, flags);
  3402 + ret = 0;
  3403 + goto leave;
  3404 + }
  3405 +
3398 3406 if (lockres->l_flags & OCFS2_LOCK_BUSY) {
3399 3407 /* XXX
3400 3408 * This is a *big* race. The OCFS2_LOCK_PENDING flag