[Ocfs2-commits] mfasheh commits r2695 - branches/ocfs2-1.0/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Nov 9 17:58:31 CST 2005


Author: mfasheh
Signed-off-by: khackel
Date: 2005-11-09 17:58:30 -0600 (Wed, 09 Nov 2005)
New Revision: 2695

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

Signed-off-by: khackel



Modified: branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c	2005-11-09 23:25:07 UTC (rev 2694)
+++ branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c	2005-11-09 23:58:30 UTC (rev 2695)
@@ -242,6 +242,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);
 }
@@ -1554,10 +1555,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);
@@ -1578,9 +1580,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