Patch from Neil Brown <neilb@cse.unsw.edu.au>

On Monday March 17, sim@netnation.com wrote:
> Just booted from 2.5.65-BK6 to 2.5.65 after an unexpected lockup in X,
> and found weird MD messages at boot followed by an amazingly fast
> (broken :)) resync.  /proc/mdstat now reports:

Sorry 'bout that.

Should be fixed by following patch.



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

diff -puN drivers/md/raid1.c~raid1-fix drivers/md/raid1.c
--- 25/drivers/md/raid1.c~raid1-fix	2003-03-17 22:00:42.000000000 -0800
+++ 25-akpm/drivers/md/raid1.c	2003-03-17 22:00:42.000000000 -0800
@@ -840,7 +840,8 @@ static void sync_request_write(mddev_t *
 			 * we read from here, no need to write
 			 */
 			continue;
-		if (conf->mirrors[i].rdev->in_sync && mddev->in_sync)
+		if (conf->mirrors[i].rdev->in_sync && 
+			r1_bio->sector + (bio->bi_size>>9) <= mddev->recovery_cp)
 			/*
 			 * don't need to write this we are just rebuilding
 			 */

_