[Ocfs2-commits] mfasheh commits r2479 - trunk/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jul 26 16:51:09 CDT 2005


Author: mfasheh
Signed-off-by: khackel
Date: 2005-07-26 16:51:09 -0500 (Tue, 26 Jul 2005)
New Revision: 2479

Modified:
   trunk/fs/ocfs2/dlmglue.c
Log:
* don't clear the BUSY flag on DLM_CANCELGRANT                  
  
* we can't get DLM_CANCELGRANT back from dlmunlock itself, so don't try to  
  handle it there.

Signed-off-by: khackel



Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-07-26 18:50:08 UTC (rev 2478)
+++ trunk/fs/ocfs2/dlmglue.c	2005-07-26 21:51:09 UTC (rev 2479)
@@ -1854,6 +1854,9 @@
 	if (status == DLM_CANCELGRANT &&
 	    lockres->l_unlock_action == OCFS2_UNLOCK_CANCEL_CONVERT) {
 		mlog(0, "Ok, got cancelgrant for %s\n", lockres->l_name);
+		/* We don't clear the busy flag in this case as it
+		 * should have been cleared by the ast which the dlm
+		 * has called. */
 		goto complete_unlock;
 	}
 
@@ -1875,9 +1878,10 @@
 	default:
 		BUG();
 	}
+
+	lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
 complete_unlock:
 	lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
-	lockres_clear_flags(lockres, OCFS2_LOCK_BUSY);
 	spin_unlock(&lockres->l_lock);
 
 	wake_up(&lockres->l_event);
@@ -2112,17 +2116,7 @@
 			   LKM_CANCEL,
 			   lockres->l_ops->unlock_ast,
 			   lockres);
-	if (status == DLM_CANCELGRANT) {
-		/* If we got this, then the ast was fired
-		 * before we could cancel. We cleanup our
-		 * state, and restart the function. */
-		spin_lock(&lockres->l_lock);
-		/* Can we race lock destruction here? Probably not but
-		 * lets double check just in case... */
-		if (lockres->l_unlock_action == OCFS2_UNLOCK_CANCEL_CONVERT)
-			lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
-		spin_unlock(&lockres->l_lock);
-	} else if (status != DLM_NORMAL) {
+	if (status != DLM_NORMAL) {
 		ocfs2_log_dlm_error("dlmunlock", status, lockres);
 		ret = -EINVAL;
 		ocfs2_recover_from_dlm_error(lockres, 0);



More information about the Ocfs2-commits mailing list