From: NeilBrown <neilb@cse.unsw.edu.au>

The logic here is wrong.  if fullsync is 0, it WILL BUG.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/md/raid1.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff -puN drivers/md/raid1.c~md-fix-bug-when-raid1-attempts-a-partial-reconstruct drivers/md/raid1.c
--- 25/drivers/md/raid1.c~md-fix-bug-when-raid1-attempts-a-partial-reconstruct	2005-05-09 22:35:54.000000000 -0700
+++ 25-akpm/drivers/md/raid1.c	2005-05-09 22:35:54.000000000 -0700
@@ -1237,13 +1237,16 @@ static sector_t sync_request(mddev_t *md
 			len = (max_sector - sector_nr) << 9;
 		if (len == 0)
 			break;
-		if (!conf->fullsync && sync_blocks == 0)
-			if (!bitmap_start_sync(mddev->bitmap,
-					       sector_nr, &sync_blocks))
-				break;
-		if (sync_blocks < (PAGE_SIZE>>9))
-			BUG();
-		if (len > (sync_blocks<<9)) len = sync_blocks<<9;
+		if (!conf->fullsync) {
+			if (sync_blocks == 0) {
+				if (!bitmap_start_sync(mddev->bitmap,
+						       sector_nr, &sync_blocks))
+					break;
+				if (sync_blocks < (PAGE_SIZE>>9))
+					BUG();
+				if (len > (sync_blocks<<9)) len = sync_blocks<<9;
+			}
+		}
 
 		for (i=0 ; i < conf->raid_disks; i++) {
 			bio = r1_bio->bios[i];
_