aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-06-05 16:08:45 -0400
committerChris Mason <clm@fb.com>2014-06-09 20:21:14 -0400
commit8a56457f5f8fa7c2698ffae8545214c5b96a2cb5 (patch)
treeb753f0914525e7bfe712d140e698ea81d29f6d3d /fs
parent6fdef6d43cb897bcbbed13786e8cc8cccabc442a (diff)
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 <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/backref.c5
1 files changed, 3 insertions, 2 deletions
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:
988 goto out; 988 goto out;
989 } 989 }
990 if (ref->count && ref->parent) { 990 if (ref->count && ref->parent) {
991 if (extent_item_pos && !ref->inode_list) { 991 if (extent_item_pos && !ref->inode_list &&
992 ref->level == 0) {
992 u32 bsz; 993 u32 bsz;
993 struct extent_buffer *eb; 994 struct extent_buffer *eb;
994 bsz = btrfs_level_size(fs_info->extent_root, 995 bsz = btrfs_level_size(fs_info->extent_root,
995 info_level); 996 ref->level);
996 eb = read_tree_block(fs_info->extent_root, 997 eb = read_tree_block(fs_info->extent_root,
997 ref->parent, bsz, 0); 998 ref->parent, bsz, 0);
998 if (!eb || !extent_buffer_uptodate(eb)) { 999 if (!eb || !extent_buffer_uptodate(eb)) {