Commit 5a699534 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] md: Make sure an interrupted resync doesn't seem to have completed.

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.
parent 5edef83d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment