[Ocfs2-commits] khackel commits r2807 - branches/ocfs2-1.2-cert/patches

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Sun Apr 2 12:38:20 CDT 2006


Author: khackel
Signed-off-by: smushran
Date: 2006-04-02 12:38:19 -0500 (Sun, 02 Apr 2006)
New Revision: 2807

Added:
   branches/ocfs2-1.2-cert/patches/fix-wait-in-mastery.patch
Modified:
   branches/ocfs2-1.2-cert/patches/series
Log:
adding fix-wait-in-mastery.patch
Signed-off-by: smushran

Added: branches/ocfs2-1.2-cert/patches/fix-wait-in-mastery.patch
===================================================================
--- branches/ocfs2-1.2-cert/patches/fix-wait-in-mastery.patch	2006-04-01 02:18:24 UTC (rev 2806)
+++ branches/ocfs2-1.2-cert/patches/fix-wait-in-mastery.patch	2006-04-02 17:38:19 UTC (rev 2807)
@@ -0,0 +1,74 @@
+Index: cert2/fs/ocfs2/dlm/dlmcommon.h
+===================================================================
+--- cert2.orig/fs/ocfs2/dlm/dlmcommon.h	2006-04-02 10:27:13.093235000 -0700
++++ cert2/fs/ocfs2/dlm/dlmcommon.h	2006-04-02 10:34:13.041599000 -0700
+@@ -700,6 +700,7 @@
+ void dlm_kick_recovery_thread(struct dlm_ctxt *dlm);
+ int dlm_is_node_dead(struct dlm_ctxt *dlm, u8 node);
+ int dlm_wait_for_node_death(struct dlm_ctxt *dlm, u8 node, int timeout);
++int dlm_wait_for_node_recovery(struct dlm_ctxt *dlm, u8 node, int timeout);
+ 
+ void dlm_get(struct dlm_ctxt *dlm);
+ void dlm_put(struct dlm_ctxt *dlm);
+Index: cert2/fs/ocfs2/dlm/dlmmaster.c
+===================================================================
+--- cert2.orig/fs/ocfs2/dlm/dlmmaster.c	2006-04-02 10:27:13.347098000 -0700
++++ cert2/fs/ocfs2/dlm/dlmmaster.c	2006-04-02 10:35:49.792463000 -0700
+@@ -888,6 +888,9 @@
+ 		} else
+ 			wait_on_recovery = 0;
+ 		spin_unlock(&dlm->spinlock);
++
++		if (wait_on_recovery)
++			dlm_wait_for_node_recovery(dlm, bit, 10000);
+ 	}
+ 
+ 	/* must wait for lock to be mastered elsewhere */
+Index: cert2/fs/ocfs2/dlm/dlmrecovery.c
+===================================================================
+--- cert2.orig/fs/ocfs2/dlm/dlmrecovery.c	2006-04-02 10:27:13.718098000 -0700
++++ cert2/fs/ocfs2/dlm/dlmrecovery.c	2006-04-02 10:34:18.857673000 -0700
+@@ -344,6 +344,18 @@
+ 	return dead;
+ }
+ 
++/* returns true if node is no longer in the domain
++ * could be dead or just not joined */
++int dlm_is_node_recovered(struct dlm_ctxt *dlm, u8 node)
++{
++	int recovered;
++	spin_lock(&dlm->spinlock);
++	recovered = !test_bit(node, dlm->recovery_map);
++	spin_unlock(&dlm->spinlock);
++	return recovered;
++}
++
++
+ int dlm_wait_for_node_death(struct dlm_ctxt *dlm, u8 node, int timeout)
+ {
+ 	if (timeout) {
+@@ -362,6 +374,24 @@
+ 	return 0;
+ }
+ 
++int dlm_wait_for_node_recovery(struct dlm_ctxt *dlm, u8 node, int timeout)
++{
++	if (timeout) {
++		mlog(ML_NOTICE, "%s: waiting %dms for notification of "
++		     "recovery of node %u\n", dlm->name, timeout, node);
++		wait_event_timeout(dlm->dlm_reco_thread_wq,
++			   dlm_is_node_recovered(dlm, node),
++			   msecs_to_jiffies(timeout));
++	} else {
++		mlog(ML_NOTICE, "%s: waiting indefinitely for notification "
++		     "of recovery of node %u\n", dlm->name, node);
++		wait_event(dlm->dlm_reco_thread_wq,
++			   dlm_is_node_recovered(dlm, node));
++	}
++	/* for now, return 0 */
++	return 0;
++}
++
+ /* callers of the top-level api calls (dlmlock/dlmunlock) should
+  * block on the dlm->reco.event when recovery is in progress.
+  * the dlm recovery thread will set this state when it begins

Modified: branches/ocfs2-1.2-cert/patches/series
===================================================================
--- branches/ocfs2-1.2-cert/patches/series	2006-04-01 02:18:24 UTC (rev 2806)
+++ branches/ocfs2-1.2-cert/patches/series	2006-04-02 17:38:19 UTC (rev 2807)
@@ -25,3 +25,4 @@
 dlm-mlog_to_printk 
 remove-bad-spin-unlock.patch 
 continue-finalize-reco.patch
+fix-wait-in-mastery.patch




More information about the Ocfs2-commits mailing list