[DRBD-cvs] svn commit by phil - r2267 - in trunk: . drbd - * Fixed a few bugs in regard to freezing of IO. Looks g

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Jul 7 15:22:40 CEST 2006


Author: phil
Date: 2006-07-07 15:22:38 +0200 (Fri, 07 Jul 2006)
New Revision: 2267

Modified:
   trunk/ROADMAP
   trunk/drbd/drbd_fs.c
   trunk/drbd/drbd_main.c
   trunk/drbd/drbd_req.c
Log:
* Fixed a few bugs in regard to freezing of IO. Looks good now.
* Started to fix bugs in regard to this usage pattern:
    create-md
    attach
    --overwrite-data-of-peer primary
    adccess device
		


Modified: trunk/ROADMAP
===================================================================
--- trunk/ROADMAP	2006-07-06 14:45:13 UTC (rev 2266)
+++ trunk/ROADMAP	2006-07-07 13:22:38 UTC (rev 2267)
@@ -802,6 +802,8 @@
    operations on the peer, but does not detach from the local disk.
    And it sets that block in the bitmap as out-of-date.
 
+   Simon works on this. 
+
 Maybe:
 
 *  Switch to protocol C in case we are running without a local 

Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c	2006-07-06 14:45:13 UTC (rev 2266)
+++ trunk/drbd/drbd_fs.c	2006-07-07 13:22:38 UTC (rev 2267)
@@ -827,6 +827,8 @@
 		dec_local(mdev);
 	}
 
+	if( fp == Stonith ) drbd_request_state(mdev,NS(susp,1));
+
 	r=drbd_khelper(mdev,"outdate-peer");
 
 	switch( (r>>8) & 0xff ) {
@@ -896,7 +898,8 @@
 	while (try++ < 3) {
 		r = _drbd_request_state(mdev,mask,val,0);
 		if( r == SS_NoConsistentDisk && (newstate & DontBlameDrbd) && 
-		    mdev->state.disk < UpToDate) {
+		    ( mdev->state.disk == Inconsistent || 
+		      mdev->state.disk == Outdated ) ) {
 			mask.disk = disk_mask;
 			val.disk  = UpToDate;
 			forced = 1;

Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2006-07-06 14:45:13 UTC (rev 2266)
+++ trunk/drbd/drbd_main.c	2006-07-07 13:22:38 UTC (rev 2267)
@@ -822,11 +822,10 @@
 	}
 
 	if( fp == Stonith ) {
-		if( !(os.role == Primary && os.conn < Connected) &&
-		     (ns.role == Primary && ns.conn < Connected) ) {
+		if(ns.role == Primary &&
+		   ns.conn < Connected &&
+		   ns.pdsk > Outdated ) {
 			ns.susp = 1;
-			ERR("ap_pending_cnt = %d while suspending IO.\n",
-			    atomic_read(&mdev->ap_pending_cnt));
 		}
 	}
 	
@@ -959,7 +958,7 @@
 	/* Here we have the actions that are performed after a
 	   state change. This function might sleep */
 
-	if( fp == Stonith && ns.susp && os.susp ) {
+	if( fp == Stonith && ns.susp ) {
 		// case1: The outdate peer handler is successfull:
 		// case2: The connection was established again:
 		if ( (os.pdsk > Outdated  && ns.pdsk <= Outdated) || // case1

Modified: trunk/drbd/drbd_req.c
===================================================================
--- trunk/drbd/drbd_req.c	2006-07-06 14:45:13 UTC (rev 2266)
+++ trunk/drbd/drbd_req.c	2006-07-07 13:22:38 UTC (rev 2267)
@@ -298,8 +298,11 @@
 	if (rw == WRITE && local)
 		drbd_al_begin_io(mdev, sector);
 
-	remote = remote && (mdev->state.pdsk >= Inconsistent);
+	remote = remote && (mdev->state.pdsk == Inconsistent ||
+			    mdev->state.pdsk == UpToDate);
 
+	D_ASSERT( (rw != WRITE) || (remote == (mdev->state.conn >= Connected)) );
+
 	if (!(local || remote)) {
 		ERR("IO ERROR: neither local nor remote disk\n");
 		goto fail_and_free_req;



More information about the drbd-cvs mailing list