From: NeilBrown Date: Wed, 24 Nov 2010 05:39:46 +0000 (+1100) Subject: md/raid1: really fix recovery looping when single good device fails. X-Git-Tag: v2.6.35.10~131 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=289f4fb78983150dcea9c06c2d8a4257d8032d49;p=karo-tx-linux.git md/raid1: really fix recovery looping when single good device fails. commit 8f9e0ee38f75d4740daa9e42c8af628d33d19a02 upstream. Commit 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 supposedly fixed a problem where if a raid1 with just one good device gets a read-error during recovery, the recovery would abort and immediately restart in an infinite loop. However it depended on raid1_remove_disk removing the spare device from the array. But that does not happen in this case. So add a test so that in the 'recovery_disabled' case, the device will be removed. This suitable for any kernel since 2.6.29 which is when recovery_disabled was introduced. Reported-by: Sebastian Färber Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andi Kleen --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a948da8012de..2e99c29164d6 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1208,6 +1208,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) * is not possible. */ if (!test_bit(Faulty, &rdev->flags) && + !mddev->recovery_disabled && mddev->degraded < conf->raid_disks) { err = -EBUSY; goto abort;