Skip to contentSkip to conversation

Btrfs: return EIO if we have extent tree corruption

PATCH New Josef Bacik 1 participant 1 message Mar 8, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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,

---
 fs/btrfs/extent-tree.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +4 -1
index dd23e8e..742b7a7 100644
@@ -1538,8 +1538,11 @@ again:
 	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]);
Signature · 1 line
1.7.7.6