[Ocfs2-commits] smushran commits r2987 - branches/ocfs2-1.2/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 12 15:27:09 PDT 2007


Author: smushran
Date: 2007-03-12 15:27:08 -0700 (Mon, 12 Mar 2007)
New Revision: 2987

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
Log:
ocfs2_dlm: Add missing locks in dlm_empty_lockres

__dlm_lockres_unused() expects the caller to take the lockres spinlock.

Signed-off-by: mfasheh

Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2007-03-12 22:24:52 UTC (rev 2986)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2007-03-12 22:27:08 UTC (rev 2987)
@@ -2724,15 +2724,18 @@
 	int ret;
 	int lock_dropped = 0;
 
+	spin_lock(&res->spinlock);
 	if (res->owner != dlm->node_num) {
 		if (!__dlm_lockres_unused(res)) {
 			mlog(ML_ERROR, "%s:%.*s: this node is not master, "
 			     "trying to free this but locks remain\n",
 			     dlm->name, res->lockname.len, res->lockname.name);
-			dlm_print_one_lock_resource(res);
+			__dlm_print_one_lock_resource(res);
 		}
+		spin_unlock(&res->spinlock);
 		goto leave;
 	}
+	spin_unlock(&res->spinlock);
 
 	/* Wheee! Migrate lockres here! Will sleep so drop spinlock. */
 	spin_unlock(&dlm->spinlock);




More information about the Ocfs2-commits mailing list