]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/md-raid1-handle-read-error.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / md-raid1-handle-read-error.patch
CommitLineData
2cb7cef9
BS
1From: NeilBrown <neilb@suse.de>
2Subject: Allow read error in single drive in raid1 to be passed up
3Patch-mainline: 2.6.29
4References: bnc#447835
5
6If a raid1 only has a single working device and gets a read error,
7we choose to simply return that error up to the filesystem (or whatever)
8rather than failing the whol array.
9
10However the codes doesn't quite do that. We attempt a readbalance
11which allocated the same drive, so we retry the read - indefinitely.
12
13Instead: If read_balance in the error case choose the same drive that just
14failed, treat it as a failure and don't retry.
15
16Signed-off-by: Neil Brown <neilb@suse.de>
17
18---
19 drivers/md/raid1.c | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
21
22--- a/drivers/md/raid1.c
23+++ b/drivers/md/raid1.c
24@@ -1637,7 +1637,8 @@ static void raid1d(mddev_t *mddev)
25 }
26
27 bio = r1_bio->bios[r1_bio->read_disk];
28- if ((disk=read_balance(conf, r1_bio)) == -1) {
29+ if ((disk=read_balance(conf, r1_bio)) == -1 ||
30+ disk == r1_bio->read_disk) {
31 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
32 " read error for block %llu\n",
33 bdevname(bio->bi_bdev,b),