summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-05-13 11:27:35 -0400
committerChris Mason <chris.mason@oracle.com>2009-05-13 11:27:35 -0400
commited20f5fc905145a0673097b539442d2a59491e77 (patch)
tree3322e73bc26816e897913538f481fd4228f7e679
parentcc04d99e90b4981b188e3308eaa1fee68af08d54 (diff)
downloadbtrfs-progs-ed20f5fc905145a0673097b539442d2a59491e77.tar.gz
Fix print-tree.c to skip blocks it can't read instead of aborting
-rw-r--r--print-tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/print-tree.c b/print-tree.c
index 5eb8bfe9..846d9662 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -450,6 +450,12 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *eb)
btrfs_node_blockptr(eb, i),
size,
btrfs_node_ptr_generation(eb, i));
+ if (!next) {
+ fprintf(stderr, "failed to read %llu in tree %llu\n",
+ (unsigned long long)btrfs_node_blockptr(eb, i),
+ (unsigned long long)btrfs_header_owner(eb));
+ continue;
+ }
if (btrfs_is_leaf(next) &&
btrfs_header_level(eb) != 1)
BUG();