[DRBD-cvs] svn commit by phil - r2063 - branches/drbd-0.7/drbd - There was a bug related to the degr-wcf-timeout config

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Thu Feb 9 12:26:22 CET 2006


Author: phil
Date: 2006-02-09 12:26:18 +0100 (Thu, 09 Feb 2006)
New Revision: 2063

Modified:
   branches/drbd-0.7/drbd/drbd_fs.c
   branches/drbd-0.7/drbd/drbd_int.h
   branches/drbd-0.7/drbd/drbd_receiver.c
Log:
There was a bug related to the degr-wcf-timeout config option, it was
no longer used in recent DRBD releases.
Over the time the a drbd_md_write() got inserted into the execution
path between the drbd_md_read() and the drbd_get_wait_time().
Fixed that.



Modified: branches/drbd-0.7/drbd/drbd_fs.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_fs.c	2006-02-08 17:40:23 UTC (rev 2062)
+++ branches/drbd-0.7/drbd/drbd_fs.c	2006-02-09 11:26:18 UTC (rev 2063)
@@ -485,6 +485,27 @@
 
 /* FIXME if (md_gc_valid < 0) META DATA IO NOT POSSIBLE! */
 
+	/* If I am currently not Primary,
+	 * but meta data primary indicator is set,
+	 * I just now recover from a hard crash,
+	 * and have been Primary before that crash.
+	 *
+	 * Now, if I had no connection before that crash
+	 * (have been degraded Primary), chances are that
+	 * I won't find my peer now either.
+	 *
+	 * In that case, and _only_ in that case,
+	 * we use the degr-wfc-timeout instead of the default,
+	 * so we can automatically recover from a crash of a
+	 * degraded but active "cluster" after a certain timeout.
+	 */
+	clear_bit(USE_DEGR_WFC_T,&mdev->flags);
+	if ( mdev->state != Primary &&
+	     drbd_md_test_flag(mdev,MDF_PrimaryInd) &&
+	    !drbd_md_test_flag(mdev,MDF_ConnectedInd) ) {
+		set_bit(USE_DEGR_WFC_T,&mdev->flags);
+	}
+
 	drbd_bm_lock(mdev); // racy...
 	if (drbd_determin_dev_size(mdev) < 0) {
 		/* could not allocate bitmap.
@@ -894,23 +915,8 @@
 	if(copy_from_user(&p,arg,sizeof(p))) {
 		return -EFAULT;
 	}
-	/* If I am currently not Primary,
-	 * but meta data primary indicator is set,
-	 * I just now recover from a hard crash,
-	 * and have been Primary before that crash.
-	 *
-	 * Now, if I had no connection before that crash
-	 * (have been degraded Primary), chances are that
-	 * I won't find my peer now either.
-	 *
-	 * In that case, and _only_ in that case,
-	 * we use the degr-wfc-timeout instead of the default,
-	 * so we can automatically recover from a crash of a
-	 * degraded but active "cluster" after a certain timeout.
-	 */
-	if ( mdev->state != Primary &&
-	     drbd_md_test_flag(mdev,MDF_PrimaryInd) &&
-	    !drbd_md_test_flag(mdev,MDF_ConnectedInd) ) {
+
+	if ( test_bit(USE_DEGR_WFC_T,&mdev->flags) ) {
 		time=p.degr_wfc_timeout;
 		if (time) WARN("using degr_wfc_timeout=%ld seconds\n", time);
 	} else {

Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================
--- branches/drbd-0.7/drbd/drbd_int.h	2006-02-08 17:40:23 UTC (rev 2062)
+++ branches/drbd-0.7/drbd/drbd_int.h	2006-02-09 11:26:18 UTC (rev 2063)
@@ -697,6 +697,7 @@
 	SENT_DISK_FAILURE,	// sending it once is enough
 	MD_DIRTY,		// current gen counts and flags not yet on disk
 	SYNC_STARTED,		// Needed to agree on the exact point in time..
+	USE_DEGR_WFC_T,		// Use degr-wfc-timeout instad of wfc-timeout.
 };
 
 struct drbd_bitmap; // opaque for Drbd_Conf

Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-02-08 17:40:23 UTC (rev 2062)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-02-09 11:26:18 UTC (rev 2063)
@@ -788,6 +788,7 @@
 	drbd_thread_start(&mdev->asender);
 
 	drbd_send_param(mdev,0);
+	clear_bit(USE_DEGR_WFC_T,&mdev->flags);
 
 	return 1;
 }



More information about the drbd-cvs mailing list