[DRBD-cvs] svn commit by phil - r2561 - trunk/drbd - Make the attach to a connected device pair work, when t

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Oct 24 11:47:03 CEST 2006


Author: phil
Date: 2006-10-24 11:47:02 +0200 (Tue, 24 Oct 2006)
New Revision: 2561

Modified:
   trunk/drbd/drbd_nl.c
   trunk/drbd/drbd_receiver.c
Log:
Make the attach to a connected device pair work, when the
joining disk has the up-to-date data.


Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c	2006-10-23 16:32:56 UTC (rev 2560)
+++ trunk/drbd/drbd_nl.c	2006-10-24 09:47:02 UTC (rev 2561)
@@ -408,7 +408,8 @@
 
 	size = drbd_new_dev_size(mdev,mdev->bc);
 
-	if( drbd_get_capacity(mdev->this_bdev) != size ) {
+	if( drbd_get_capacity(mdev->this_bdev) != size || 
+	    drbd_bm_capacity(mdev) != size ) {
 		int err;
 		err = drbd_bm_resize(mdev,size);
 		if (unlikely(err)) {

Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2006-10-23 16:32:56 UTC (rev 2560)
+++ trunk/drbd/drbd_receiver.c	2006-10-24 09:47:02 UTC (rev 2561)
@@ -2296,8 +2296,10 @@
 	ns.peer = peer_state.role;
 	ns.pdsk = peer_state.disk;
 	ns.peer_isp = ( peer_state.aftr_isp | peer_state.user_isp );
-	if(nconn == Connected && ns.disk == Negotiating ) ns.disk = UpToDate;
-	if(nconn == Connected && ns.pdsk == Negotiating ) ns.pdsk = UpToDate;
+	if((nconn == Connected || nconn == WFBitMapS) && 
+	   ns.disk == Negotiating ) ns.disk = UpToDate;
+	if((nconn == Connected || nconn == WFBitMapT) && 
+	   ns.pdsk == Negotiating ) ns.pdsk = UpToDate;
 	rv = _drbd_set_state(mdev,ns,ChgStateVerbose | ChgStateHard);
 	spin_unlock_irq(&mdev->req_lock);
 	if (rv==SS_Success) {



More information about the drbd-cvs mailing list