[Ocfs2-commits] mfasheh commits r2694 - branches/ocfs2-1.2/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Nov 9 17:25:08 CST 2005


Author: mfasheh
Signed-off-by: khackel
Date: 2005-11-09 17:25:07 -0600 (Wed, 09 Nov 2005)
New Revision: 2694

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
Log:
* backport svn r2693
	- Fix a leak in the mle cache

Signed-off-by: khackel



Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2005-11-09 23:22:25 UTC (rev 2693)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2005-11-09 23:25:07 UTC (rev 2694)
@@ -312,6 +312,7 @@
 
 	assert_spin_locked(&dlm->spinlock);
 	assert_spin_locked(&dlm->master_lock);
+	BUG_ON(!atomic_read(&mle->mle_refs.refcount));
 
 	kref_put(&mle->mle_refs, dlm_mle_release);
 }
@@ -1622,10 +1623,11 @@
 	// mlog(0, "woo!  got an assert_master from node %u!\n",
 	// 	     assert->node_idx);
 	if (mle) {
-		int block;
+		int extra_ref;
 		
 		spin_lock(&mle->spinlock);
-		block = !!(mle->type == DLM_MLE_BLOCK);
+		extra_ref = !!(mle->type == DLM_MLE_BLOCK
+			       || mle->type == DLM_MLE_MIGRATION);
 		mle->master = assert->node_idx;
 		atomic_set(&mle->woken, 1);
 		wake_up(&mle->wq);
@@ -1646,9 +1648,9 @@
 		dlm_mle_detach_hb_events(dlm, mle);
 		dlm_put_mle(mle);
 		
-		if (block) {
+		if (extra_ref) {
 			/* the assert master message now balances the extra
-		 	 * ref given by the master request message.
+		 	 * ref given by the master / migration request message.
 		 	 * if this is the last put, it will be removed
 		 	 * from the list. */
 			dlm_put_mle(mle);



More information about the Ocfs2-commits mailing list