[Ocfs2-commits] mfasheh commits r2210 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon May 2 18:36:40 CDT 2005
Author: mfasheh
Signed-off-by: manish
Date: 2005-05-02 18:36:39 -0500 (Mon, 02 May 2005)
New Revision: 2210
Modified:
trunk/fs/ocfs2/dlmglue.c
Log:
* use a proper status variable in __ocfs2_downconvert_lock
* guard against a theoretical race in __ocfs2_cancel_convert
Signed-off-by: manish
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-05-01 22:14:21 UTC (rev 2209)
+++ trunk/fs/ocfs2/dlmglue.c 2005-05-02 23:36:39 UTC (rev 2210)
@@ -1841,7 +1841,8 @@
int new_level,
int lvb)
{
- int status, flags = LKM_CONVERT;
+ int ret, flags = LKM_CONVERT;
+ dlm_status status;
mlog_entry_void();
@@ -1874,15 +1875,15 @@
lockres->l_ops->bast);
if (status != DLM_NORMAL) {
mlog(ML_ERROR, "Dlm returns %d\n", status);
- status = -ENOENT;
+ ret = -ENOENT;
ocfs2_recover_from_dlm_error(lockres, 1);
goto bail;
}
- status = 0;
+ ret = 0;
bail:
- mlog_exit(status);
- return status;
+ mlog_exit(ret);
+ return ret;
}
/* called with the spinlock held, and WILL drop it. */
@@ -1915,7 +1916,10 @@
* before we could cancel. We cleanup our
* state, and restart the function. */
spin_lock(&lockres->l_lock);
- lockres->l_unlock_action = OCFS2_UNLOCK_INVALID;
+ /* 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) {
mlog(ML_ERROR, "Dlm returns %d\n", status);
More information about the Ocfs2-commits
mailing list