Commit 8a56457f authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: don't check nodes for extent items

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: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 6fdef6d4
...@@ -988,11 +988,12 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, ...@@ -988,11 +988,12 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
goto out; goto out;
} }
if (ref->count && ref->parent) { if (ref->count && ref->parent) {
if (extent_item_pos && !ref->inode_list) { if (extent_item_pos && !ref->inode_list &&
ref->level == 0) {
u32 bsz; u32 bsz;
struct extent_buffer *eb; struct extent_buffer *eb;
bsz = btrfs_level_size(fs_info->extent_root, bsz = btrfs_level_size(fs_info->extent_root,
info_level); ref->level);
eb = read_tree_block(fs_info->extent_root, eb = read_tree_block(fs_info->extent_root,
ref->parent, bsz, 0); ref->parent, bsz, 0);
if (!eb || !extent_buffer_uptodate(eb)) { if (!eb || !extent_buffer_uptodate(eb)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment