I think this was an oversight and the rh_in_sync call should be allowed
to block in do_reads.  Any reason why it is not coded that way?

 brassow

do_reads happens in the mirror worker thread and operations there are
allowed to block.  The call to rh_in_sync should be allowed to block.

This is especially important for cluster mirroring.  Since the
cluster log must ensure the region is in_sync cluster-wide and
must do network operations to ensure that, it will always return
-EWOULDBLOCK if 0 is given for the blocking argument.  The way
the code is written, a cluster mirror would never be allowed to
'choose_mirror'.

---
 drivers/md/dm-raid1.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.21-rc5/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.21-rc5.orig/drivers/md/dm-raid1.c	2007-04-05 16:30:20.000000000 +0100
+++ linux-2.6.21-rc5/drivers/md/dm-raid1.c	2007-04-05 16:30:27.000000000 +0100
@@ -741,7 +741,7 @@ static void do_reads(struct mirror_set *
 		/*
 		 * We can only read balance if the region is in sync.
 		 */
-		if (rh_in_sync(&ms->rh, region, 0))
+		if (rh_in_sync(&ms->rh, region, 1))
 			m = choose_mirror(ms, bio->bi_sector);
 		else
 			m = ms->default_mirror;
