]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/md-raid1-really-fix-recovery-looping-when-single-good-device-fails.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / md-raid1-really-fix-recovery-looping-when-single-good-device-fails.patch
1 From 8f9e0ee38f75d4740daa9e42c8af628d33d19a02 Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Wed, 24 Nov 2010 16:39:46 +1100
4 Subject: md/raid1: really fix recovery looping when single good device fails.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: NeilBrown <neilb@suse.de>
10
11 commit 8f9e0ee38f75d4740daa9e42c8af628d33d19a02 upstream.
12
13 Commit 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 supposedly fixed a
14 problem where if a raid1 with just one good device gets a read-error
15 during recovery, the recovery would abort and immediately restart in
16 an infinite loop.
17
18 However it depended on raid1_remove_disk removing the spare device
19 from the array. But that does not happen in this case. So add a test
20 so that in the 'recovery_disabled' case, the device will be removed.
21
22 This suitable for any kernel since 2.6.29 which is when
23 recovery_disabled was introduced.
24
25 Reported-by: Sebastian Färber <faerber@gmail.com>
26 Signed-off-by: NeilBrown <neilb@suse.de>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
28
29 ---
30 drivers/md/raid1.c | 1 +
31 1 file changed, 1 insertion(+)
32
33 --- a/drivers/md/raid1.c
34 +++ b/drivers/md/raid1.c
35 @@ -1210,6 +1210,7 @@ static int raid1_remove_disk(mddev_t *md
36 * is not possible.
37 */
38 if (!test_bit(Faulty, &rdev->flags) &&
39 + !mddev->recovery_disabled &&
40 mddev->degraded < conf->raid_disks) {
41 err = -EBUSY;
42 goto abort;