[DRBD-cvs] svn commit by phil - r2570 - trunk/drbd - Make sure that drbd_asb_recover_0p() find a decissions.

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Oct 25 11:36:45 CEST 2006


Author: phil
Date: 2006-10-25 11:36:44 +0200 (Wed, 25 Oct 2006)
New Revision: 2570

Modified:
   trunk/drbd/drbd_receiver.c
Log:
Make sure that drbd_asb_recover_0p() find a decissions. I think it
is more important that it find a decission than that is uses the
algorithm the user selected. 

In case the selected algorithm can not find a decission we try
the others as well...


Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2006-10-25 09:15:32 UTC (rev 2569)
+++ trunk/drbd/drbd_receiver.c	2006-10-25 09:36:44 UTC (rev 2570)
@@ -1669,15 +1669,15 @@
 	case Disconnect:
 		break;
 	case DiscardYoungerPri:
-		if (self == 0 && peer == 1) rv = -1;
-		if (self == 1 && peer == 0) rv =  1;
-		D_ASSERT(self != peer);
-		break;
+		if (self == 0 && peer == 1) { rv = -1; break; }
+		if (self == 1 && peer == 0) { rv =  1; break; }
+		/* Else fall through to one of the other strategies... */
 	case DiscardOlderPri:
-		if (self == 0 && peer == 1) rv =  1;
-		if (self == 1 && peer == 0) rv = -1;
-		D_ASSERT(self != peer);
-		break;
+		if (self == 0 && peer == 1) { rv =  1; break; }
+		if (self == 1 && peer == 0) { rv = -1; break; }
+		/* Else fall through to one of the other strategies... */
+		WARN("Discard younger/older primary did not found a decision\n"
+		     "Using discard-least-changes instead\n");
 	case DiscardLeastChg:
 		ch_peer = mdev->p_uuid[UUID_SIZE];
 		ch_self = drbd_bm_total_weight(mdev);



More information about the drbd-cvs mailing list