From: majianpeng Date: Tue, 22 May 2012 03:55:03 +0000 (+1000) Subject: md/raid1: allow fix_read_error to read from recovering device. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da8840a747c0dbf49506ec906757a6b87b9741e9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git md/raid1: allow fix_read_error to read from recovering device. When attempting to fix a read error, it is acceptable to read from a device that is recovering, provided the recovery has got past the place we are reading from. This makes the test for "can we read from here" the same as the test in read_balance. Signed-off-by: majianpeng Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 71a7dc038a82..22cfc6660b18 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1859,7 +1859,9 @@ static void fix_read_error(struct r1conf *conf, int read_disk, rdev = conf->mirrors[d].rdev; if (rdev && - test_bit(In_sync, &rdev->flags) && + (test_bit(In_sync, &rdev->flags) || + (!test_bit(Faulty, &rdev->flags) && + rdev->recovery_offset >= sect + s)) && is_badblock(rdev, sect, s, &first_bad, &bad_sectors) == 0 && sync_page_io(rdev, sect, s<<9,