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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Apr 28 11:08:10 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-28 11:08:08 -0500 (Thu, 28 Apr 2005)
New Revision: 2193

Modified:
   trunk/fs/ocfs2/dlmglue.c
Log:
* __ocfs2_cancel_convert was returning error on success, fix this.

Signed-off-by: manish



Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-04-27 22:54:37 UTC (rev 2192)
+++ trunk/fs/ocfs2/dlmglue.c	2005-04-28 16:08:08 UTC (rev 2193)
@@ -1891,7 +1891,8 @@
 static int __ocfs2_cancel_convert(ocfs_super *osb,
 				  ocfs2_lock_res *lockres)
 {
-	int status;
+	int ret;
+	dlm_status status;
 
 	mlog_entry_void();
 
@@ -1905,14 +1906,12 @@
 	lockres->l_unlock_action = OCFS2_UNLOCK_CANCEL_CONVERT;
 	spin_unlock(&lockres->l_lock);
 
+	ret = 0;
 	status = dlmunlock(osb->dlm,
 			   &lockres->l_lksb,
 			   LKM_CANCEL,
 			   lockres->l_ops->unlock_ast,
 			   lockres);
-	if (status == DLM_NORMAL)
-		status = 0;
-
 	if (status == DLM_CANCELGRANT) {
 		/* If we got this, then the ast was fired
 		 * before we could cancel. We cleanup our
@@ -1920,16 +1919,16 @@
 		spin_lock(&lockres->l_lock);
 		lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
 		spin_unlock(&lockres->l_lock);
-	} else {
+	} else if (status != DLM_NORMAL) {
 		mlog(ML_ERROR, "Dlm returns %d\n", status);
-		status = -ENOENT;
+		ret = -ENOENT;
 		ocfs2_recover_from_dlm_error(lockres, 0);
 	}
 
 	mlog(0, "lock %s return from dlmunlock\n", lockres->l_name);
 
-	mlog_exit(status);
-	return status;
+	mlog_exit(ret);
+	return ret;
 }
 
 static inline int ocfs2_can_downconvert_meta_lock(struct inode *inode,



More information about the Ocfs2-commits mailing list