[DRBD-cvs] svn commit by phil - r2738 - trunk/drbd - In case we need to become primary, when the peer was pr

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Feb 5 18:24:50 CET 2007


Author: phil
Date: 2007-02-05 18:24:49 +0100 (Mon, 05 Feb 2007)
New Revision: 2738

Modified:
   trunk/drbd/drbd_nl.c
Log:
In case we need to become primary, when the peer was primary,
but we got rebooted before we try to get primary, and the
fencing policy is set to resource(-something).

Then we end up with SS_NoUpToDateDisk in drbd_set_role(),
and need to handle this there.


Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c	2007-01-31 17:23:47 UTC (rev 2737)
+++ trunk/drbd/drbd_nl.c	2007-02-05 17:24:49 UTC (rev 2738)
@@ -254,6 +254,23 @@
 			forced = 1;
 			continue;
 		}
+
+		if( r == SS_NoUpToDateDisk &&
+		    mdev->state.disk == Consistent ) {
+			D_ASSERT(mdev->state.pdsk == DUnknown);
+			nps = drbd_try_outdate_peer(mdev);
+
+			if(nps == Outdated) {
+				val.disk = UpToDate;
+				mask.disk = disk_mask;
+			}
+
+			val.pdsk = nps;
+			mask.pdsk = disk_mask;
+			
+			continue;
+		}
+
 		if ( r == SS_NothingToDo ) goto fail;
 		if ( r == SS_PrimaryNOP ) {
 			nps = drbd_try_outdate_peer(mdev);



More information about the drbd-cvs mailing list