Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276138
b: refs/heads/master
c: f4a8e65
h: refs/heads/master
v: v3
  • Loading branch information
Jan Schmidt authored and Chris Mason committed Dec 1, 2011
1 parent ae081d4 commit 9892771
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be064d113906f04ea13088a8260e1e68ae0a4050
refs/heads/master: f4a8e6563ea5366f563cb741a27fe90c5fa7f0fc
27 changes: 20 additions & 7 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2287,21 +2287,34 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
if (!uptodate) {
int failed_mirror;
failed_mirror = (int)(unsigned long)bio->bi_bdev;
if (tree->ops && tree->ops->readpage_io_failed_hook)
ret = tree->ops->readpage_io_failed_hook(
bio, page, start, end,
failed_mirror, state);
else
ret = bio_readpage_error(bio, page, start, end,
failed_mirror, NULL);
/*
* The generic bio_readpage_error handles errors the
* following way: If possible, new read requests are
* created and submitted and will end up in
* end_bio_extent_readpage as well (if we're lucky, not
* in the !uptodate case). In that case it returns 0 and
* 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) {
error_handled:
uptodate =
test_bit(BIO_UPTODATE, &bio->bi_flags);
if (err)
uptodate = 0;
uncache_state(&cached);
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) {
Expand Down

0 comments on commit 9892771

Please sign in to comment.