[DRBD-cvs] svn commit by phil - r2544 - branches/drbd-0.7/drbd - Backports of two bugfixes to the drbd08 branch. *) Made

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Oct 18 18:55:46 CEST 2006


Author: phil
Date: 2006-10-18 18:55:45 +0200 (Wed, 18 Oct 2006)
New Revision: 2544

Modified:
   branches/drbd-0.7/drbd/drbd_receiver.c
   branches/drbd-0.7/drbd/drbd_req.c
   branches/drbd-0.7/drbd/drbd_worker.c
Log:
Backports of two bugfixes to the drbd08 branch.

*) Made sure that the asender never misses a wakup signal.

*) Made sure that DRBD ends IO-requests with the barrier flag
   set by itself with -EOPNOTSUPP


Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-10-18 15:06:14 UTC (rev 2543)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-10-18 16:55:45 UTC (rev 2544)
@@ -2304,6 +2304,7 @@
 	int received = 0;
 	int expect   = sizeof(Drbd_Header);
 	int cmd      = -1;
+	int empty;
 
 	static struct asender_cmd asender_tbl[] = {
 		[Ping]      ={ sizeof(Drbd_Header),           got_Ping },
@@ -2330,17 +2331,19 @@
 				mdev->conf.timeout*HZ/20;
 		}
 
-		/* FIXME this *should* be below drbd_process_ee,
-		 * but that leads to some distributed deadlock :-(
-		 * this needs to be fixed properly, I'd vote for a separate
-		 * msock sender thread, but others will frown upon yet an other
-		 * kernel thread...
-		 *	-- lge
-		 */
-		set_bit(SIGNAL_ASENDER, &mdev->flags);
-
-		if (!drbd_process_ee(mdev,0)) goto err;
-
+		while(1) {
+			if (!drbd_process_ee(mdev,0)) {
+				ERR("process_done_ee() = NOT_OK\n");
+				goto err;
+			}
+			set_bit(SIGNAL_ASENDER, &mdev->flags);
+			spin_lock_irq(&mdev->req_lock);
+			empty = list_empty(&mdev->done_ee);
+			spin_unlock_irq(&mdev->req_lock);
+			if(empty) break;
+			clear_bit(SIGNAL_ASENDER, &mdev->flags);
+			flush_signals(current);
+		}
 		rv = drbd_recv_short(mdev,buf,expect-received);
 		clear_bit(SIGNAL_ASENDER, &mdev->flags);
 

Modified: branches/drbd-0.7/drbd/drbd_req.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_req.c	2006-10-18 15:06:14 UTC (rev 2543)
+++ branches/drbd-0.7/drbd/drbd_req.c	2006-10-18 16:55:45 UTC (rev 2544)
@@ -168,6 +168,13 @@
 	drbd_request_t *req;
 	int local, remote;
 
+ONLY_IN_26(
+	/* Currently our BARRIER code is disabled. */
+	if(unlikely(bio_barrier(bio))) {
+		bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+		return 0;
+	}
+)
 	if (unlikely(drbd_did_panic == DRBD_MAGIC)) {
 		drbd_bio_IO_error(bio);
 		return 0;

Modified: branches/drbd-0.7/drbd/drbd_worker.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_worker.c	2006-10-18 15:06:14 UTC (rev 2543)
+++ branches/drbd-0.7/drbd/drbd_worker.c	2006-10-18 16:55:45 UTC (rev 2544)
@@ -286,6 +286,8 @@
 	ERR_IF (bio->bi_size)
 		return 1;
 
+	if(error) DUMPI(error);
+
 	drbd_chk_io_error(mdev,error);
         // req may get freed within drbd_end_req
 	rsector = req->sector;



More information about the drbd-cvs mailing list