[DRBD-cvs] svn commit by phil - r2764 - trunk/drbd - * It deadlocked upon becoming secondary if the AL was c

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Feb 21 11:57:11 CET 2007


Author: phil
Date: 2007-02-21 11:57:09 +0100 (Wed, 21 Feb 2007)
New Revision: 2764

Modified:
   trunk/drbd/drbd_actlog.c
   trunk/drbd/drbd_receiver.c
Log:
* It deadlocked upon becoming secondary if the AL was completely empty. Fixed that.
* More verbosity when bio_add_page() failes in the receiver.


Modified: trunk/drbd/drbd_actlog.c
===================================================================
--- trunk/drbd/drbd_actlog.c	2007-02-20 17:00:13 UTC (rev 2763)
+++ trunk/drbd/drbd_actlog.c	2007-02-21 10:57:09 UTC (rev 2764)
@@ -690,8 +690,15 @@
 		}
 
 		drbd_blk_run_queue(bdev_get_queue(mdev->bc->md_bdev));
-		wait_for_completion(&wc.io_done);
 
+		// In case we did not submit a single IO do not wait for
+		// them to complete. ( Because we would wait forever here. )
+		//
+		// In case we had IOs and they are already complete, there
+		// is not point in waiting anyways.
+		// Therefore this if() ...
+		if(atomic_read(&wc.io_done)) wait_for_completion(&wc.io_done);
+
 		dec_local(mdev);
 
 		if(wc.error) drbd_io_error(mdev, TRUE);

Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c	2007-02-20 17:00:13 UTC (rev 2763)
+++ trunk/drbd/drbd_receiver.c	2007-02-21 10:57:09 UTC (rev 2764)
@@ -268,7 +268,8 @@
 		}
 		if (!bio_add_page(bio, page, min_t(int, ds, PAGE_SIZE), 0)) {
 			drbd_pp_free(mdev,page);
-			ERR("alloc_ee: bio_add_page() failed\n");
+			ERR("alloc_ee: bio_add_page(s=%llu,ds=%u) failed\n",
+			    (unsigned long long)sector, ds);
 			goto fail2;
 			break;
 		}



More information about the drbd-cvs mailing list