[Ocfs2-commits] jlbec commits r2793 - branches/ocfs2-1.2-cert/patches

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 27 18:45:23 CST 2006


Author: jlbec
Signed-off-by: khackel
Date: 2006-03-27 18:45:22 -0600 (Mon, 27 Mar 2006)
New Revision: 2793

Added:
   branches/ocfs2-1.2-cert/patches/fix-dlmlock_remote.patch
   branches/ocfs2-1.2-cert/patches/hold-dirty-ref.patch
Modified:
   branches/ocfs2-1.2-cert/patches/series
Log:

o Fix dlm_remote unhashing a lockres on a retry.
o Hold a reference when locks are on the dirty list.

Signed-off-by: khackel



Added: branches/ocfs2-1.2-cert/patches/fix-dlmlock_remote.patch
===================================================================
--- branches/ocfs2-1.2-cert/patches/fix-dlmlock_remote.patch	2006-03-27 23:32:36 UTC (rev 2792)
+++ branches/ocfs2-1.2-cert/patches/fix-dlmlock_remote.patch	2006-03-28 00:45:22 UTC (rev 2793)
@@ -0,0 +1,33 @@
+Index: ocfs2/fs/ocfs2/dlm/dlmlock.c
+===================================================================
+--- ocfs2-orig/fs/ocfs2/dlm/dlmlock.c	(revision 2785)
++++ ocfs2/fs/ocfs2/dlm/dlmlock.c	(working copy)
+@@ -200,6 +200,7 @@ static enum dlm_status dlmlock_remote(st
+ 				      struct dlm_lock *lock, int flags)
+ {
+ 	enum dlm_status status = DLM_DENIED;
++	int lockres_changed = 1;
+ 
+ 	mlog_entry("type=%d\n", lock->ml.type);
+ 	mlog(0, "lockres %.*s, flags = 0x%x\n", res->lockname.len,
+@@ -229,6 +230,10 @@ static enum dlm_status dlmlock_remote(st
+ 			dlm_error(status);
+ 		dlm_revert_pending_lock(res, lock);
+ 		dlm_lock_put(lock);
++		/* do NOT call calc_usage, as this would unhash the remote
++		 * lockres before we ever get to use it.  treat as if we
++		 * never made any change to the lockres. */
++		lockres_changed = 0;
+ 	} else if (dlm_is_recovery_lock(res->lockname.name, 
+ 					res->lockname.len)) {
+ 		/* special case for the $RECOVERY lock.
+@@ -243,7 +248,8 @@ static enum dlm_status dlmlock_remote(st
+ 	}
+ 	spin_unlock(&res->spinlock);
+ 
+-	dlm_lockres_calc_usage(dlm, res);
++	if (lockres_changed)
++		dlm_lockres_calc_usage(dlm, res);
+ 
+ 	wake_up(&res->wq);
+ 	return status;

Added: branches/ocfs2-1.2-cert/patches/hold-dirty-ref.patch
===================================================================
--- branches/ocfs2-1.2-cert/patches/hold-dirty-ref.patch	2006-03-27 23:32:36 UTC (rev 2792)
+++ branches/ocfs2-1.2-cert/patches/hold-dirty-ref.patch	2006-03-28 00:45:22 UTC (rev 2793)
@@ -0,0 +1,63 @@
+diff -ur --exclude '*.o' --exclude '*.ko' --exclude '*.mod.c' --exclude 'stamp*' --exclude .svn ocfs2-1.2-cert/fs/ocfs2/dlm/dlmcommon.h ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h
+--- ocfs2-1.2-cert/fs/ocfs2/dlm/dlmcommon.h	2006-03-27 15:18:00.081080000 -0800
++++ ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h	2006-03-27 15:15:10.305299000 -0800
+@@ -219,18 +219,26 @@
+ 	struct hlist_node hash_node;
+ 	struct kref      refs;
+ 
+-	/* please keep these next 3 in this order
+-	 * some funcs want to iterate over all lists */
++	/*
++	 * Please keep granted, converting, and blocked in this order,
++	 * as some funcs want to iterate over all lists.
++	 *
++	 * All four lists are protected by the hash's reference.
++	 */
+ 	struct list_head granted;
+ 	struct list_head converting;
+ 	struct list_head blocked;
++	struct list_head purge;
+ 
++	/*
++	 * These two lists require you to hold an additional reference
++	 * while they are on the list.
++	 */
+ 	struct list_head dirty;
+ 	struct list_head recovering; // dlm_recovery_ctxt.resources list
+ 
+ 	/* unused lock resources have their last_used stamped and are
+ 	 * put on a list for the dlm thread to run. */
+-	struct list_head purge;
+ 	unsigned long    last_used;
+ 
+ 	unsigned migration_pending:1;
+diff -ur --exclude '*.o' --exclude '*.ko' --exclude '*.mod.c' --exclude 'stamp*' --exclude .svn ocfs2-1.2-cert/fs/ocfs2/dlm/dlmthread.c ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c
+--- ocfs2-1.2-cert/fs/ocfs2/dlm/dlmthread.c	2006-03-27 15:18:00.162080000 -0800
++++ ocfs2-1.2/fs/ocfs2/dlm/dlmthread.c	2006-03-27 15:10:06.086591000 -0800
+@@ -466,6 +466,8 @@
+ 	/* don't shuffle secondary queues */
+ 	if ((res->owner == dlm->node_num) &&
+ 	    !(res->state & DLM_LOCK_RES_DIRTY)) {
++		/* ref for dirty_list */
++		dlm_lockres_get(res);
+ 		list_add_tail(&res->dirty, &dlm->dirty_list);
+ 		res->state |= DLM_LOCK_RES_DIRTY;
+ 	}
+@@ -657,6 +659,8 @@
+ 			list_del_init(&res->dirty);
+ 			spin_unlock(&res->spinlock);
+ 			spin_unlock(&dlm->spinlock);
++			/* Drop dirty_list ref */
++			dlm_lockres_put(res);
+ 
+ 		 	/* lockres can be re-dirtied/re-added to the
+ 			 * dirty_list in this gap, but that is ok */
+@@ -709,6 +713,8 @@
+ 			/* if the lock was in-progress, stick
+ 			 * it on the back of the list */
+ 			if (delay) {
++				/* ref for dirty_list */
++				dlm_lockres_get(res);
+ 				spin_lock(&res->spinlock);
+ 				list_add_tail(&res->dirty, &dlm->dirty_list);
+ 				res->state |= DLM_LOCK_RES_DIRTY;

Modified: branches/ocfs2-1.2-cert/patches/series
===================================================================
--- branches/ocfs2-1.2-cert/patches/series	2006-03-27 23:32:36 UTC (rev 2792)
+++ branches/ocfs2-1.2-cert/patches/series	2006-03-28 00:45:22 UTC (rev 2793)
@@ -14,4 +14,6 @@
 mar24-create-lock-handler.patch -p0
 mastery-restart-recovery.patch -p0
 leave-other-dead-nodes-on-recovery-list.patch 
+hold-dirty-ref.patch
 fix-recovery-spin.patch
+fix-dlmlock_remote.patch




More information about the Ocfs2-commits mailing list