summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-08 21:41:02 +0100
committerChris Mason <chris.mason@fusionio.com>2013-03-14 19:57:29 +0100
commit492104c866cb1b62a11393adccb477f5cd2c7768 (patch)
tree1aacf5abaf22d0a591b4cb39e494c95694fb589c
parentbtrfs: use rcu_barrier() to wait for bdev puts at unmount (diff)
downloadlinux-492104c866cb1b62a11393adccb477f5cd2c7768.tar.xz
linux-492104c866cb1b62a11393adccb477f5cd2c7768.zip
Btrfs: return EIO if we have extent tree corruption
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 <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index aaee2b7fee78..350b9b18140c 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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]);