]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 Mon Sep 17 00:00:00 2001 |
2 | From: NeilBrown <neilb@suse.de> | |
3 | Date: Fri, 9 Jan 2009 08:31:11 +1100 | |
4 | Subject: [PATCH] md: don't retry recovery of raid1 that fails due to error on source drive. | |
5 | ||
6 | If a raid1 has only one working drive and it has a sector which | |
7 | gives an error on read, then an attempt to recover onto a spare will | |
8 | fail, but as the single remaining drive is not removed from the | |
9 | array, the recovery will be immediately re-attempted, resulting | |
10 | in an infinite recovery loop. | |
11 | ||
12 | So detect this situation and don't retry recovery once an error | |
13 | on the lone remaining drive is detected. | |
14 | ||
15 | Allow recovery to be retried once every time a spare is added | |
16 | in case the problem wasn't actually a media error. | |
17 | ||
18 | Signed-off-by: NeilBrown <neilb@suse.de> | |
19 | --- | |
20 | drivers/md/md.c | 3 +++ | |
21 | 1 file changed, 3 insertions(+) | |
22 | ||
23 | --- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c | |
24 | +++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c | |
25 | @@ -1512,6 +1512,9 @@ static int bind_rdev_to_array(mdk_rdev_t | |
26 | list_add_rcu(&rdev->same_set, &mddev->disks); | |
27 | bd_claim_by_disk(rdev->bdev, rdev->bdev->bd_holder, mddev->gendisk); | |
28 | md_integrity_check(rdev, mddev); | |
29 | + | |
30 | + /* May as well allow recovery to be retried once */ | |
31 | + clear_bit(MD_RECOVERY_DISABLED, &mddev->recovery); | |
32 | return 0; | |
33 | ||
34 | fail: |