[DRBD-cvs] svn commit by phil - r3005 - branches/drbd-8.0/drbd - Ernest pointed out that we erroneously created a new cu

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Aug 1 17:05:53 CEST 2007


Author: phil
Date: 2007-08-01 17:05:52 +0200 (Wed, 01 Aug 2007)
New Revision: 3005

Modified:
   branches/drbd-8.0/drbd/drbd_main.c
Log:
Ernest pointed out that we erroneously created a new current_id
each time a diskless peer become secondary. We should do that
only the first time...

By the way, I enlosed this in a inc_local() - dec_local() pair, 
since mdev->bc gets dereferenced in this code block. 



Modified: branches/drbd-8.0/drbd/drbd_main.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_main.c	2007-08-01 14:26:12 UTC (rev 3004)
+++ branches/drbd-8.0/drbd/drbd_main.c	2007-08-01 15:05:52 UTC (rev 3005)
@@ -931,15 +931,17 @@
 		}
 	}
 
-	if( ns.pdsk < Inconsistent ) {
+	if (ns.pdsk < Inconsistent && inc_local(mdev)) {
 		/* Diskless Peer becomes primary */
-		if (os.peer == Secondary && ns.peer == Primary ) {
+		if (os.peer == Secondary && ns.peer == Primary &&
+		    mdev->bc->md.uuid[Bitmap] == 0) {
 			drbd_uuid_new_current(mdev);
 		}
 		/* Diskless Peer becomes secondary */
 		if (os.peer == Primary && ns.peer == Secondary ) {
 			drbd_al_to_on_disk_bm(mdev);
 		}
+		dec_local(mdev);
 	}
 
 	/* Last part of the attaching process ... */



More information about the drbd-cvs mailing list