Skip to content

Commit

Permalink
Btrfs: don't check nodes for extent items
Browse files Browse the repository at this point in the history
The backref code was looking at nodes as well as leaves when we tried to
populate extent item entries.  This is not good, and although we go away with it
for the most part because we'd skip where disk_bytenr != random_memory,
sometimes random_memory would match and suddenly boom.  This fixes that problem.
Thanks,

Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Josef Bacik authored and masoncl committed Jun 10, 2014
1 parent 6fdef6d commit 8a56457
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,12 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
goto out;
}
if (ref->count && ref->parent) {
if (extent_item_pos && !ref->inode_list) {
if (extent_item_pos && !ref->inode_list &&
ref->level == 0) {
u32 bsz;
struct extent_buffer *eb;
bsz = btrfs_level_size(fs_info->extent_root,
info_level);
ref->level);
eb = read_tree_block(fs_info->extent_root,
ref->parent, bsz, 0);
if (!eb || !extent_buffer_uptodate(eb)) {
Expand Down

0 comments on commit 8a56457

Please sign in to comment.