[DRBD-cvs] svn commit by phil - r2478 - trunk/drbd - * Changing the sync conf created an act_log. Fixed that

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Sep 29 15:51:57 CEST 2006


Author: phil
Date: 2006-09-29 15:51:56 +0200 (Fri, 29 Sep 2006)
New Revision: 2478

Modified:
   trunk/drbd/drbd_main.c
   trunk/drbd/drbd_nl.c
Log:
* Changing the sync conf created an act_log. Fixed that.
* The after state function dared to look at mdev->bc without
  inc_loca() / dec_local()


Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2006-09-29 09:15:51 UTC (rev 2477)
+++ trunk/drbd/drbd_main.c	2006-09-29 13:51:56 UTC (rev 2478)
@@ -626,7 +626,7 @@
 		fp = mdev->bc->dc.fencing;
 		dec_local(mdev);
 	}
-
+ 
 	/* Early state sanitising. Dissalow the invalidate ioctl to connect  */
 	if( (ns.conn == StartingSyncS || ns.conn == StartingSyncT) &&
 		os.conn < Connected ) {
@@ -857,13 +857,11 @@
 	fp = DontCare;
 	if(inc_local(mdev)) {
 		fp = mdev->bc->dc.fencing;
-		dec_local(mdev);
-	}
 
-	if( ns.disk >= Inconsistent ) {
 		mdf = mdev->bc->md.flags & ~(MDF_Consistent|MDF_PrimaryInd|
 					     MDF_ConnectedInd|MDF_WasUpToDate|
 					     MDF_PeerOutDated );
+
 		if (test_bit(CRASHED_PRIMARY,&mdev->flags) ||
 		    mdev->state.role == Primary ||
 		    ( mdev->state.pdsk < Inconsistent && 
@@ -872,12 +870,12 @@
 		if (mdev->state.disk > Inconsistent)   mdf |= MDF_Consistent;
 		if (mdev->state.disk > Outdated)       mdf |= MDF_WasUpToDate;
 		if (mdev->state.pdsk <= Outdated && 
-		    mdev->state.pdsk >= Inconsistent)  mdf |= MDF_PeerOutDated;
-
+		    mdev->state.pdsk >= Inconsistent)  mdf |= MDF_PeerOutDated;	
 		if( mdf != mdev->bc->md.flags) {
 			mdev->bc->md.flags = mdf;
 			drbd_md_mark_dirty(mdev);
 		}
+		dec_local(mdev);
 	}
 
 	/* Inform userspace about the change... */

Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c	2006-09-29 09:15:51 UTC (rev 2477)
+++ trunk/drbd/drbd_nl.c	2006-09-29 13:51:56 UTC (rev 2478)
@@ -1232,11 +1232,15 @@
 	mdev->sync_conf.rate       = sc.rate;
 	mdev->sync_conf.al_extents = sc.al_extents;
 
-	err = drbd_check_al_size(mdev);
-	drbd_md_sync(mdev);
-	if (err) {
-		retcode = KMallocFailed;
-		goto fail;
+	if(inc_local(mdev)) {
+		err = drbd_check_al_size(mdev);
+		dec_local(mdev);
+		drbd_md_sync(mdev);
+
+		if (err) {
+			retcode = KMallocFailed;
+			goto fail;
+		}
 	}
 
 	if (mdev->state.conn >= Connected)



More information about the drbd-cvs mailing list