diff options
author | majianpeng <majianpeng@gmail.com> | 2012-05-21 23:55:03 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-21 23:55:03 -0400 |
commit | da8840a747c0dbf49506ec906757a6b87b9741e9 (patch) | |
tree | 127835ac03aaf4f3ecd188c665a9970047174c26 | |
parent | 4fa2f327681808f653711e14203a42cf4644bda0 (diff) |
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 <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | drivers/md/raid1.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, | |||
1859 | 1859 | ||
1860 | rdev = conf->mirrors[d].rdev; | 1860 | rdev = conf->mirrors[d].rdev; |
1861 | if (rdev && | 1861 | if (rdev && |
1862 | test_bit(In_sync, &rdev->flags) && | 1862 | (test_bit(In_sync, &rdev->flags) || |
1863 | (!test_bit(Faulty, &rdev->flags) && | ||
1864 | rdev->recovery_offset >= sect + s)) && | ||
1863 | is_badblock(rdev, sect, s, | 1865 | is_badblock(rdev, sect, s, |
1864 | &first_bad, &bad_sectors) == 0 && | 1866 | &first_bad, &bad_sectors) == 0 && |
1865 | sync_page_io(rdev, sect, s<<9, | 1867 | sync_page_io(rdev, sect, s<<9, |