[Ocfs2-commits] mfasheh commits r2149 - trunk/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Apr 18 23:57:54 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-18 23:57:53 -0500 (Mon, 18 Apr 2005)
New Revision: 2149

Modified:
   trunk/fs/ocfs2/dlmglue.c
Log:
* Put an assert_spin_locked into some of the lockres flag setting /
  clearing functions. Should help us catch bugs in the future.

Signed-off-by: manish



Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c	2005-04-19 04:57:00 UTC (rev 2148)
+++ trunk/fs/ocfs2/dlmglue.c	2005-04-19 04:57:53 UTC (rev 2149)
@@ -454,6 +454,8 @@
 	struct list_head *pos, *tmp;
 	struct ocfs2_lockres_flag_callback *fcb;
 
+	assert_spin_locked(&lockres->l_lock);
+
 	lockres->l_flags = newflags;
 
 	list_for_each_safe(pos, tmp, &lockres->l_flag_cb_list) {
@@ -880,6 +882,8 @@
 	BUG_ON(!list_empty(&fcb->fc_lockres_item));
 	BUG_ON(fcb->fc_cb == NULL);
 
+	assert_spin_locked(&lockres->l_lock);
+
 	list_add_tail(&fcb->fc_lockres_item, &lockres->l_flag_cb_list);
 	fcb->fc_flag_mask = mask;
 	fcb->fc_flag_goal = goal;
@@ -1088,8 +1092,11 @@
 	 * valid when we release the EX. */
 
 	lockres = &OCFS_I(inode)->ip_meta_lockres;
+
+	spin_lock(&lockres->l_lock);
 	OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
 	lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
+	spin_unlock(&lockres->l_lock);
 
 	status = ocfs2_lock_create(osb, lockres, LKM_EXMODE, LKM_LOCAL);
 	if (status < 0) {
@@ -1098,8 +1105,11 @@
 	}
 
 	lockres = &OCFS_I(inode)->ip_data_lockres;
+
+	spin_lock(&lockres->l_lock);
 	OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
 	lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
+	spin_unlock(&lockres->l_lock);
 
 	status = ocfs2_lock_create(osb, lockres, LKM_EXMODE, LKM_LOCAL);
 	if (status < 0) {



More information about the Ocfs2-commits mailing list