]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/md-raid1-handle-read-error.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / md-raid1-handle-read-error.patch
1 From: NeilBrown <neilb@suse.de>
2 Subject: Allow read error in single drive in raid1 to be passed up
3 Patch-mainline: 2.6.29
4 References: bnc#447835
5
6 If a raid1 only has a single working device and gets a read error,
7 we choose to simply return that error up to the filesystem (or whatever)
8 rather than failing the whol array.
9
10 However the codes doesn't quite do that. We attempt a readbalance
11 which allocated the same drive, so we retry the read - indefinitely.
12
13 Instead: If read_balance in the error case choose the same drive that just
14 failed, treat it as a failure and don't retry.
15
16 Signed-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),