summaryrefslogtreecommitdiff
path: root/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-07-05 13:44:07 -0400
committerChris Mason <chris.mason@fusionio.com>2013-07-05 13:44:07 -0400
commit194aa4a1bd6447bb545286d0bcb0b0be8204d79f (patch)
treec512cb21116a3347a968bbb19b1c0fd76c2f5773 /ctree.c
parent8b5d89be6d3997f9bbaddb23a4408fcb8b50be8f (diff)
btrfs-restore: deal with NULL returns from read_node_slot
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'ctree.c')
-rw-r--r--ctree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctree.c b/ctree.c
index 2a400ec7..1a4f3f06 100644
--- a/ctree.c
+++ b/ctree.c
@@ -797,7 +797,8 @@ struct extent_buffer *read_node_slot(struct btrfs_root *root,
if (slot >= btrfs_header_nritems(parent))
return NULL;
- BUG_ON(level == 0);
+ if (level == 0)
+ return NULL;
return read_tree_block(root, btrfs_node_blockptr(parent, slot),
btrfs_level_size(root, level - 1),