[DRBD-cvs] svn commit by phil - r2249 - branches/drbd-0.7/drbd - In case you use a non default AL size, and both nodes o

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Jun 26 12:19:43 CEST 2006


Author: phil
Date: 2006-06-26 12:19:41 +0200 (Mon, 26 Jun 2006)
New Revision: 2249

Modified:
   branches/drbd-0.7/drbd/drbd_fs.c
   branches/drbd-0.7/drbd/drbd_int.h
   branches/drbd-0.7/drbd/drbd_main.c
   branches/drbd-0.7/drbd/drbd_receiver.c
Log:
In case you use a non default AL size, and both nodes of your
cluster crash simultaniously, DRBD failed to start the resync
of the AL covered areas.
Fixed now.


Modified: branches/drbd-0.7/drbd/drbd_fs.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_fs.c	2006-06-23 13:32:46 UTC (rev 2248)
+++ branches/drbd-0.7/drbd/drbd_fs.c	2006-06-26 10:19:41 UTC (rev 2249)
@@ -528,6 +528,8 @@
 	}
 
 	apply_al = drbd_md_test_flag(mdev,MDF_PrimaryInd);
+	if(apply_al) set_bit(CRASHED_PRIMARY, &mdev->flags);
+	else       clear_bit(CRASHED_PRIMARY, &mdev->flags);
 	/* All tests on MDF_PrimaryInd and MDF_ConnectedInd must happen before 
 	   this point, because determin_dev_size() might call drbd_md_write(), 
 	   which in turn modifies these flags. Exceptions are where, we want
@@ -922,6 +924,7 @@
 			    mdev->cstate >= Connected ?
 			    ConnectedCnt : ArbitraryCnt);
 		}
+		clear_bit(CRASHED_PRIMARY, &mdev->flags);
 	} else {
 		NOT_IN_26( set_device_ro(MKDEV(MAJOR_NR, minor), TRUE ); )
 		ONLY_IN_26( set_disk_ro(mdev->vdisk, TRUE ); )

Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================
--- branches/drbd-0.7/drbd/drbd_int.h	2006-06-23 13:32:46 UTC (rev 2248)
+++ branches/drbd-0.7/drbd/drbd_int.h	2006-06-26 10:19:41 UTC (rev 2249)
@@ -681,6 +681,7 @@
 	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.
+	CRASHED_PRIMARY         // This node was a crashed primary
 };
 
 struct drbd_bitmap; // opaque for Drbd_Conf

Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-06-23 13:32:46 UTC (rev 2248)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-06-26 10:19:41 UTC (rev 2249)
@@ -2009,7 +2009,8 @@
 	memset(buffer,0,512);
 
 	flags = mdev->gen_cnt[Flags] & ~(MDF_PrimaryInd|MDF_ConnectedInd);
-	if (mdev->state  == Primary)        flags |= MDF_PrimaryInd;
+	if (mdev->state  == Primary || 
+	    test_bit(CRASHED_PRIMARY, &mdev->flags))   flags |= MDF_PrimaryInd;
 	if (mdev->cstate >= WFReportParams) flags |= MDF_ConnectedInd;
 	mdev->gen_cnt[Flags] = flags;
 

Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-06-23 13:32:46 UTC (rev 2248)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-06-26 10:19:41 UTC (rev 2249)
@@ -1647,6 +1647,7 @@
 		D_ASSERT(h->command == ReportBitMap);
 	}
 
+	clear_bit(CRASHED_PRIMARY, &mdev->flags); // md_write() is in drbd_start_resync.
 	if (mdev->cstate == WFBitMapS) {
 		drbd_start_resync(mdev,SyncSource);
 	} else if (mdev->cstate == WFBitMapT) {



More information about the drbd-cvs mailing list