1
0
Fork 0

Btrfs: avoid I/O repair BUG() from btree_read_extent_buffer_pages()

From btree_read_extent_buffer_pages(), currently repair_io_failure()
can be called with mirror_num being zero when submit_one_bio() returned
an error before. This used to cause a BUG_ON(!mirror_num) in
repair_io_failure() and indeed this is not a case that needs the I/O
repair code to rewrite disk blocks.
This commit prevents calling repair_io_failure() in this case and thus
avoids the BUG_ON() and malfunction.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
hifive-unleashed-5.1
Stefan Behrens 2012-07-10 07:30:17 -06:00 committed by Chris Mason
parent f4c738c2e7
commit c0901581ad
1 changed files with 1 additions and 1 deletions

View File

@ -407,7 +407,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
break;
}
if (failed && !ret)
if (failed && !ret && failed_mirror)
repair_eb_io_failure(root, eb, failed_mirror);
return ret;