- if (btrfs_is_leaf(next) &&
- btrfs_header_level(eb) != 1)
- BUG();
- if (btrfs_header_level(next) !=
- btrfs_header_level(eb) - 1)
- BUG();
+ if (btrfs_is_leaf(next) && btrfs_header_level(eb) != 1) {
+ warning(
+ "eb corrupted: item %d eb level %d next level %d, skipping the rest",
+ i, btrfs_header_level(next),
+ btrfs_header_level(eb));
+ goto out;
+ }
+ if (btrfs_header_level(next) != btrfs_header_level(eb) - 1) {
+ warning(
+ "eb corrupted: item %d eb level %d next level %d, skipping the rest",
+ i, btrfs_header_level(next),
+ btrfs_header_level(eb));
+ goto out;
+ }