[DRBD-cvs] svn commit by phil - r2529 - branches/drbd-0.7/drbd - IO_FROZEN feature: Fixed the corner case, that Lars poi

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Oct 13 09:39:39 CEST 2006


Author: phil
Date: 2006-10-13 09:39:38 +0200 (Fri, 13 Oct 2006)
New Revision: 2529

Modified:
   branches/drbd-0.7/drbd/drbd_main.c
Log:
IO_FROZEN feature:
 Fixed the corner case, that Lars pointed out. 


Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-10-12 16:18:48 UTC (rev 2528)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-10-13 07:39:38 UTC (rev 2529)
@@ -1114,15 +1114,31 @@
 	 * in down(). we have to check that, to avoid a race with tl_clear
 	 * cleaning up before we can tl_add */
 	if (unlikely(!mdev->data.socket)) {
-		/* this req is not in the tl, tl_clear cannot find it.
-		 * we cannot just tl_add it here, either, because tl_clear
-		 * might be done already.  so we have to mark this request
-		 * "SENT" here, otherwise it won't ever complete.
-		 * FIXME won't work for freeze io.
-		 * FIXME if we are Diskless, we complete a WRITE
-		 * as successful here, that has never been written! */
-		drbd_set_out_of_sync(mdev, req->sector, req->size);
-		drbd_end_req(req,RQ_DRBD_SENT,1);
+                /* this req is not in the tl, tl_clear cannot find it.
+                 *
+                 * For Freeze-IO,
+                 * we add the req to the tl anyways, possibly creating
+                 * a new epoch, and then do nothing.  It will then still be
+                 * submitted locally, but it cannot possibly signal
+                 * completion to the upper layers before it was
+                 * resent (tl_resend) or canceled (tl_clear).
+                 *
+                 * Otherwise,
+                 * we cannot just tl_add it here, either, because tl_clear
+                 * might be done already.  so we have to mark this request
+                 * "SENT" here, otherwise it won't ever complete.
+                 * FIXME if we are Diskless, we complete a WRITE
+                 * as successful here, that has never been written! */
+		if (test_bit(IO_FROZEN,&mdev->flags)) {
+			if(test_and_clear_bit(ISSUE_BARRIER,&mdev->flags)) {
+				inc_ap_pending(mdev);
+				tl_add_barrier(mdev);
+			}
+			tl_add(mdev,req);
+		} else {
+			drbd_set_out_of_sync(mdev, req->sector, req->size);
+			drbd_end_req(req,RQ_DRBD_SENT,1);
+		}
 		goto out;
 	}
 



More information about the drbd-cvs mailing list