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

If the raid1 or raid5 thread gets to run md_check_recovery after the recovery
thread has been interupted, but before do_md_stop completes, a spare drive
can be incorporated into an array befure it is up-to-date.

This patch corrects the relevant test.



---

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

diff -puN drivers/md/md.c~md-03-resync-interrupt-fix drivers/md/md.c
--- 25/drivers/md/md.c~md-03-resync-interrupt-fix	Thu Jan 15 17:36:17 2004
+++ 25-akpm/drivers/md/md.c	Thu Jan 15 17:36:17 2004
@@ -3383,7 +3383,8 @@ void md_check_recovery(mddev_t *mddev)
 			/* resync has finished, collect result */
 			md_unregister_thread(mddev->sync_thread);
 			mddev->sync_thread = NULL;
-			if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery)) {
+			if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
+			    !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
 				/* success...*/
 				/* activate any spares */
 				mddev->pers->spare_active(mddev);

_
