[DRBD-cvs] svn commit by lars - r2411 - trunk/drbd - I'd like to dec_ap_pending only _after_ we completed th

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Sep 13 12:40:37 CEST 2006


Author: lars
Date: 2006-09-13 12:40:36 +0200 (Wed, 13 Sep 2006)
New Revision: 2411

Modified:
   trunk/drbd/drbd_req.c
Log:

I'd like to dec_ap_pending only _after_ we completed the master bio.

I may not remove from the transfer log if I never have been there :(



Modified: trunk/drbd/drbd_req.c
===================================================================
--- trunk/drbd/drbd_req.c	2006-09-12 18:17:42 UTC (rev 2410)
+++ trunk/drbd/drbd_req.c	2006-09-13 10:40:36 UTC (rev 2411)
@@ -177,9 +177,9 @@
 		 * up here anyways during the freeze ...
 		 * then again, if it is a READ, it is not in the TL at all.
 		 * is it still leagal to complete a READ during freeze? */
-		dec_ap_bio(mdev);
 		bio_endio(req->master_bio, req->master_bio->bi_size, ok ? 0 : -EIO);
 		req->master_bio = NULL;
+		dec_ap_bio(mdev);
 	} else {
 		/* only WRITE requests can end up here without a master_bio */
 		rw = WRITE;
@@ -195,8 +195,10 @@
 		 * bit(s) out-of-sync first. If it had a local part, we need to
 		 * release the reference to the activity log. */
 		if (rw == WRITE) {
-			/* remove it from the transfer log */
-			list_del(&req->tl_requests);
+			/* remove it from the transfer log.  well, only if it
+			 * had been there in the first place... */
+			if (s & RQ_NET_MASK)
+				list_del(&req->tl_requests);
 			/* Set out-of-sync unless both OK flags are set 
 			 * (local only or remote failed).
 			 * Other places where we set out-of-sync:



More information about the drbd-cvs mailing list