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.
/* 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);