Skip to content

Commit

Permalink
Btrfs: return EIO if we have extent tree corruption
Browse files Browse the repository at this point in the history
The callers of lookup_inline_extent_info all handle getting an error back
properly, so return an error if we have corruption instead of being a jerk and
panicing.  Still WARN_ON() since this is kind of crucial and I've been seeing it
a bit too much recently for my taste, I think we're doing something wrong
somewhere.  Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Mar 14, 2013
1 parent bc17862 commit 492104c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,11 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
if (ret && !insert) {
err = -ENOENT;
goto out;
} else if (ret) {
err = -EIO;
WARN_ON(1);
goto out;
}
BUG_ON(ret); /* Corruption */

leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, path->slots[0]);
Expand Down

0 comments on commit 492104c

Please sign in to comment.