]> git.hungrycats.org Git - linux/commitdiff
[PATCH] md: Make sure an interrupted resync doesn't seem to have completed.
authorAndrew Morton <akpm@osdl.org>
Tue, 20 Jan 2004 11:12:09 +0000 (03:12 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 20 Jan 2004 11:12:09 +0000 (03:12 -0800)
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.

drivers/md/md.c

index ba0562e6e2e958458a701ef287236810356d341a..95c8f87ba83c6eb811e3a2889227aa9baa8a56b6 100644 (file)
@@ -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);