diff -u hurd-debian/ufs/inode.c hurd-20120520/ufs/inode.c
--- hurd-debian/ufs/inode.c	2012-05-16 23:33:20.000000000 -0600
+++ hurd-20120520/ufs/inode.c	2012-06-14 15:38:09.000000000 -0600
@@ -75,6 +75,8 @@
   dn->dir_idx = 0;
 
   pthread_rwlock_init (&dn->allocptrlock, NULL);
+  pthread_mutex_init(&dn->waitlock, NULL);
+  pthread_cond_init(&dn->waitcond, NULL);
   dn->dirty = 0;
   dn->fileinfo = 0;
 
diff -u hurd-debian/ufs/pager.c hurd-20120520/ufs/pager.c
--- hurd-debian/ufs/pager.c	2012-05-16 23:33:20.000000000 -0600
+++ hurd-20120520/ufs/pager.c	2012-06-14 17:29:49.000000000 -0600
@@ -96,12 +96,29 @@
 	     don't acquire it; check again from the top.
 	     This is mutated inline from rwlock.h.  */
 	  lock = &np->dn->allocptrlock;
+	   /*
+	      TD - Why do we lock first?
+		To prevent this nigh-impossible scenario:
+		  1) trylock - writer has lock
+		  2) switch back to writer before we lock waitlock
+		  3) writer finishes: releases lock and broadcasts
+		  4) we wait for a condition that will never get broadcast
+		With this, either we get the lock, or we get the signal.
+	   */
+	  pthread_mutex_lock (&np->dn->waitlock);
 	  if (pthread_rwlock_tryrdlock (lock))
 	    {
-	      pthread_rwlock_rdlock (lock);
-	      pthread_rwlock_unlock (lock);
+	       /*
+		  TD - we now don't block on the rwlock. Instead, we wait on a
+		  condition that will be signalled when the lock is unlocked,
+		  or when it is safe not to lock the page. We don't spin on an
+		  invariant, as spurius wakeups can do no harm.
+	       */
+	      pthread_cond_wait(&np->dn->waitcond, &np->dn->waitlock);
+	      pthread_mutex_unlock (&np->dn->waitlock);
 	      goto try_again;
 	    }
+	  pthread_mutex_unlock (&np->dn->waitlock);
 	  *nplock = lock;
 	}
       else
@@ -272,6 +289,10 @@
       printf ("attempt to unlock at last block denied\n");
       fflush (stdout);
       pthread_rwlock_unlock (&dn->allocptrlock);
+      /* Wake up any remaining sleeping readers. Wow, so much work.... */
+      pthread_mutex_lock (&dn->waitlock);
+      pthread_cond_broadcast(&dn->waitcond);
+      pthread_mutex_unlock (&dn->waitlock);
       return EIO;
     }
 
@@ -279,6 +300,9 @@
   if (err)
     {
       pthread_rwlock_unlock (&dn->allocptrlock);
+      pthread_mutex_lock (&dn->waitlock);
+      pthread_cond_broadcast(&dn->waitcond);
+      pthread_mutex_unlock (&dn->waitlock);
       return EIO;
     }
 
@@ -286,6 +310,9 @@
   if (err)
     {
       pthread_rwlock_unlock (&dn->allocptrlock);
+      pthread_mutex_lock (&dn->waitlock);
+      pthread_cond_broadcast(&dn->waitcond);
+      pthread_mutex_unlock (&dn->waitlock);
       return EIO;
     }
 
@@ -417,6 +444,9 @@
  out:
   diskfs_end_catch_exception ();
   pthread_rwlock_unlock (&dn->allocptrlock);
+  pthread_mutex_lock (&dn->waitlock);
+  pthread_cond_broadcast(&dn->waitcond);
+  pthread_mutex_unlock (&dn->waitlock);
   return err;
 }
 
diff -u hurd-debian/ufs/sizes.c hurd-20120520/ufs/sizes.c
--- hurd-debian/ufs/sizes.c	2012-05-16 23:33:20.000000000 -0600
+++ hurd-20120520/ufs/sizes.c	2012-06-14 18:00:02.000000000 -0600
@@ -251,6 +251,12 @@
   diskfs_node_update (np, 1);
 
   pthread_rwlock_unlock (&np->dn->allocptrlock);
+  /* Wake up any remaining sleeping readers.
+     This sequence of three calls is now necessary whenever we acquire a write
+     lock on allocptrlock. If we do not, we may leak some readers. */
+  pthread_mutex_lock (&np->dn->waitlock);
+  pthread_cond_broadcast(&np->dn->waitcond);
+  pthread_mutex_unlock (&np->dn->waitlock);
 
   /* At this point the last block (as defined by np->allocsize)
      might not be allocated.  We need to allocate it to maintain
@@ -422,12 +428,16 @@
 
       /* Make sure all waiting pageins see this change. */
       /* BDD - Is this sane? */
-      /* pthread_mutex_lock (&np->dn->allocptrlock.master); */
-      /* pthread_cond_broadcast (&np->dn->allocptrlock.wakeup); */
-      /* pthread_mutex_unlock (&np->dn->allocptrlock.master); */
-      pthread_rwlock_rdlock (&np->dn->allocptrlock);
-      /* pthread_cond_broadcast (&wakeup); */
-      pthread_rwlock_unlock (&np->dn->allocptrlock);
+      /* TD - No... no it wasn't. But, it looked right. */
+       /*
+	 This new code should, SHOULD, behave as the original code did.
+	 This will wake up all readers waiting on the lock. This code favors
+	 strongly writers, but, as of making this change, pthreads favors
+	 writers, and cthreads did favor writers.
+       */
+      pthread_mutex_lock (&np->dn->waitlock);
+      pthread_cond_broadcast(&np->dn->waitcond);
+      pthread_mutex_unlock (&np->dn->waitlock);
 
       /* Force the pages in core and make sure they are dirty */
       for (pokeaddr = (int *)mapaddr; 
@@ -685,6 +695,9 @@
     }
 
   pthread_rwlock_unlock (&np->dn->allocptrlock);
+  pthread_mutex_lock (&np->dn->waitlock);
+  pthread_cond_broadcast(&np->dn->waitcond);
+  pthread_mutex_unlock (&np->dn->waitlock);
 
   if (need_sync)
     diskfs_file_update (np, 1);
diff -u hurd-debian/ufs/ufs.h hurd-20120520/ufs/ufs.h
--- hurd-debian/ufs/ufs.h	2012-05-16 23:33:20.000000000 -0600
+++ hurd-20120520/ufs/ufs.h	2012-06-14 15:38:10.000000000 -0600
@@ -55,6 +55,8 @@
   struct node *hnext, **hprevp;
 
   pthread_rwlock_t allocptrlock;
+  pthread_mutex_t waitlock;
+  pthread_cond_t waitcond;
 
   struct dirty_indir *dirty;
 
