Skip to contentSkip to conversation

ocfs2: Remove overzealous BUG_ON during blocked lock processing

PATCH New Sunil Mushran 1 participant 1 message Feb 2, 2010 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]> assisted in fixing this issue.

---
 fs/ocfs2/dlmglue.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
fs/ocfs2/dlmglue.c +10 -2
index 2918c2c..1c4d704 100644
@@ -3392,9 +3392,17 @@ static int ocfs2_unblock_lock(struct ocfs2_super *osb,
 
 	spin_lock_irqsave(&lockres->l_lock, flags);
 
-	BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
-
 recheck:
+	/*
+	 * Is it still blocking? If not, we have no more work to do.
+	 */
+	if (!(lockres->l_flags & OCFS2_LOCK_BLOCKED)) {
+		BUG_ON(lockres->l_blocking != DLM_LOCK_NL);
+		spin_unlock_irqrestore(&lockres->l_lock, flags);
+		ret = 0;
+		goto leave;
+	}
+
 	if (lockres->l_flags & OCFS2_LOCK_BUSY) {
 		/* XXX
 		 * This is a *big* race.  The OCFS2_LOCK_PENDING flag
Signature · 1 line
1.6.3.3