]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / 0003-md-don-t-retry-recovery-of-raid1-that-fails-due-to-e.patch
CommitLineData
2cb7cef9
BS
1From 4044ba58dd15cb01797c4fd034f39ef4a75f7cc3 Mon Sep 17 00:00:00 2001
2From: NeilBrown <neilb@suse.de>
3Date: Fri, 9 Jan 2009 08:31:11 +1100
4Subject: [PATCH] md: don't retry recovery of raid1 that fails due to error on source drive.
5
6If a raid1 has only one working drive and it has a sector which
7gives an error on read, then an attempt to recover onto a spare will
8fail, but as the single remaining drive is not removed from the
9array, the recovery will be immediately re-attempted, resulting
10in an infinite recovery loop.
11
12So detect this situation and don't retry recovery once an error
13on the lone remaining drive is detected.
14
15Allow recovery to be retried once every time a spare is added
16in case the problem wasn't actually a media error.
17
18Signed-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: