[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drbd-cvs
Subject:    [DRBD-cvs] svn commit by phil - r2637 - trunk/drbd - In the
From:       drbd-cvs () linbit ! com
Date:       2006-12-20 11:49:03
Message-ID: 20061220114903.AA5702CFF89E () mail ! linbit ! com
[Download RAW message or body]

Author: phil
Date: 2006-12-20 12:49:02 +0100 (Wed, 20 Dec 2006)
New Revision: 2637

Modified:
   trunk/drbd/drbd_main.c
Log:
In the after_state_ch() function we missed to create a new current-UUID
in case the pdsk (peer disk) goes directly into the Outdated state.
 [Happens when the peer disconnects itself.]

Fixed that.


Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2006-12-19 16:20:27 UTC (rev 2636)
+++ trunk/drbd/drbd_main.c	2006-12-20 11:49:02 UTC (rev 2637)
@@ -889,8 +889,8 @@
 	}
 
 	/* Lost contact to peer's copy of the data */
-	if ( (os.pdsk >= Inconsistent && os.pdsk != DUnknown) &&
-	     (ns.pdsk < Inconsistent || ns.pdsk == DUnknown)) {
+	if ( (os.pdsk>=Inconsistent && os.pdsk!=DUnknown && os.pdsk!=Outdated) &&
+	     (ns.pdsk<Inconsistent || ns.pdsk==DUnknown || ns.pdsk==Outdated) ) {
 		if ( mdev->p_uuid ) {
 			kfree(mdev->p_uuid);
 			mdev->p_uuid = NULL;
@@ -898,7 +898,6 @@
 		if (inc_local(mdev)) {
 			if (ns.role == Primary && mdev->bc->md.uuid[Bitmap] == 0 ) {
 				/* Only do it if we have not yet done it... */
-				INFO("Creating new current UUID\n");
 				drbd_uuid_new_current(mdev);
 			}
 			if (ns.peer == Primary ) { 
@@ -920,7 +919,6 @@
 	if( ns.pdsk < Inconsistent ) {
 		/* Diskless Peer becomes primary */
 		if (os.peer == Secondary && ns.peer == Primary ) {
-			INFO("Creating new current UUID\n");
 			drbd_uuid_new_current(mdev);
 		}
 		/* Diskless Peer becomes secondary */
@@ -2715,6 +2713,7 @@
 
 void drbd_uuid_new_current(drbd_dev *mdev)
 {
+	INFO("Creating new current UUID\n");
 	D_ASSERT(mdev->bc->md.uuid[Bitmap] == 0);
 	mdev->bc->md.uuid[Bitmap] = mdev->bc->md.uuid[Current];
 	MTRACE(TraceTypeUuid,TraceLvlMetrics,

_______________________________________________
drbd-cvs mailing list
drbd-cvs@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic