[Ocfs2-commits] khackel commits r2466 - trunk/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Jul 11 14:03:01 CDT 2005


Author: khackel
Signed-off-by: mfasheh
Date: 2005-07-11 14:03:00 -0500 (Mon, 11 Jul 2005)
New Revision: 2466

Modified:
   trunk/fs/ocfs2/dlm/dlmconvert.c
Log:
* fixes a bug in the convert path: if a convert request was made on
  an already-converting lock it was mistakenly put on the granted
  list in the error path

Signed-off-by: mfasheh



Modified: trunk/fs/ocfs2/dlm/dlmconvert.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmconvert.c	2005-07-11 00:32:46 UTC (rev 2465)
+++ trunk/fs/ocfs2/dlm/dlmconvert.c	2005-07-11 19:03:00 UTC (rev 2466)
@@ -276,21 +276,20 @@
 	/* will exit this call with spinlock held */
 	__dlm_wait_on_lockres(res);
 
-	res->state |= DLM_LOCK_RES_IN_PROGRESS;
-
-	/* move lock to local convert queue */
-	/* do not alter lock refcount.  switching lists. */
-	list_del_init(&lock->list);
-	list_add_tail(&lock->list, &res->converting);
-	lock->convert_pending = 1;
 	if (lock->ml.convert_type != LKM_IVMODE) {
 		__dlm_print_one_lock_resource(res);
 		mlog(ML_ERROR, "converting a remote lock that is already "
 		     "converting! (cookie=%"MLFu64", conv=%d)\n",
 		     lock->ml.cookie, lock->ml.convert_type);
 		status = DLM_DENIED;
-		goto denied;
+		goto bail;
 	}
+	res->state |= DLM_LOCK_RES_IN_PROGRESS;
+	/* move lock to local convert queue */
+	/* do not alter lock refcount.  switching lists. */
+	list_del_init(&lock->list);
+	list_add_tail(&lock->list, &res->converting);
+	lock->convert_pending = 1;
 	lock->ml.convert_type = type;
 
 	if (flags & LKM_VALBLK) {
@@ -313,7 +312,6 @@
 	status = dlm_send_remote_convert_request(dlm, res, lock, flags, type);
 
 	spin_lock(&res->spinlock);
-denied:
 	res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
 	lock->convert_pending = 0;
 	/* if it failed, move it back to granted queue */



More information about the Ocfs2-commits mailing list