From: Josef Bacik Date: Thu, 5 Jun 2014 20:08:45 +0000 (-0400) Subject: Btrfs: don't check nodes for extent items X-Git-Tag: v3.16-rc1~45^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8a56457f5f8fa7c2698ffae8545214c5b96a2cb5;p=karo-tx-linux.git 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: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index f09aa18ab710..84d0912eecb2 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -988,11 +988,12 @@ again: 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)) {