mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
Btrfs: fix meta data raid-repair merge problem
Commit4a54c8c16
introduced raid-repair, killing the individual readpage_io_failed_hook entries from inode.c and disk-io.c. Commit4bb31e92
introduced new readahead code, adding a readpage_io_failed_hook to disk-io.c. The raid-repair commit had logic to disable raid-repair, if readpage_io_failed_hook is set. Thus, the readahead commit effectively disabled raid-repair for meta data. This commit changes the logic to always attempt raid-repair when needed and call the readpage_io_failed_hook in case raid-repair fails. This is much more straight forward and should have been like that from the beginning. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Reported-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
be064d1139
commit
f4a8e6563e
1 changed files with 20 additions and 7 deletions
|
@ -2287,14 +2287,20 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
|
||||||
if (!uptodate) {
|
if (!uptodate) {
|
||||||
int failed_mirror;
|
int failed_mirror;
|
||||||
failed_mirror = (int)(unsigned long)bio->bi_bdev;
|
failed_mirror = (int)(unsigned long)bio->bi_bdev;
|
||||||
if (tree->ops && tree->ops->readpage_io_failed_hook)
|
/*
|
||||||
ret = tree->ops->readpage_io_failed_hook(
|
* The generic bio_readpage_error handles errors the
|
||||||
bio, page, start, end,
|
* following way: If possible, new read requests are
|
||||||
failed_mirror, state);
|
* created and submitted and will end up in
|
||||||
else
|
* end_bio_extent_readpage as well (if we're lucky, not
|
||||||
ret = bio_readpage_error(bio, page, start, end,
|
* in the !uptodate case). In that case it returns 0 and
|
||||||
failed_mirror, NULL);
|
* we just go on with the next page in our bio. If it
|
||||||
|
* can't handle the error it will return -EIO and we
|
||||||
|
* remain responsible for that page.
|
||||||
|
*/
|
||||||
|
ret = bio_readpage_error(bio, page, start, end,
|
||||||
|
failed_mirror, NULL);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
error_handled:
|
||||||
uptodate =
|
uptodate =
|
||||||
test_bit(BIO_UPTODATE, &bio->bi_flags);
|
test_bit(BIO_UPTODATE, &bio->bi_flags);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -2302,6 +2308,13 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
|
||||||
uncache_state(&cached);
|
uncache_state(&cached);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (tree->ops && tree->ops->readpage_io_failed_hook) {
|
||||||
|
ret = tree->ops->readpage_io_failed_hook(
|
||||||
|
bio, page, start, end,
|
||||||
|
failed_mirror, state);
|
||||||
|
if (ret == 0)
|
||||||
|
goto error_handled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uptodate) {
|
if (uptodate) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue