Skip to contentSkip to conversation

md - 3 of 10 - Make sure an interrupted resync doesn't seem to have completed.

PATCH New NeilBrown 1 participant 1 message Jan 16, 2004 MD RAID

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 md - 3 of 10 - Make sure an interrupted resync doesn't seem to have completed.

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.

----------- Diffstat output ------------

 ./drivers/md/md.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c renamed from drivers/md/md.c~current~ +2 -1
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
@@ -3379,7 +3379,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);