1 Upstream-Status: Inappropriate [Backport]
2 From 32ba8209276d3ac1723ea6373aaec9d6399ce5ca Mon Sep 17 00:00:00 2001
3 From: Miao Xie <miaox@cn.fujitsu.com>
4 Date: Tue, 13 Jul 2010 09:18:04 +0000
5 Subject: [PATCH 14/15] btrfs-progs: fix wrong extent buffer size when reading tree block
7 the root extent buffer of a tree may not be a leaf, so we must get the right
8 size by its level when reading it.
10 Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
11 Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 1 files changed, 3 insertions(+), 1 deletions(-)
16 diff --git a/debug-tree.c b/debug-tree.c
17 index 0525354..99c12d6 100644
20 @@ -212,7 +212,9 @@ again:
21 read_extent_buffer(leaf, &ri, offset, sizeof(ri));
22 buf = read_tree_block(tree_root_scan,
23 btrfs_root_bytenr(&ri),
24 - tree_root_scan->leafsize, 0);
25 + btrfs_level_size(tree_root_scan,
26 + btrfs_root_level(&ri)),
28 switch(found_key.objectid) {
29 case BTRFS_ROOT_TREE_OBJECTID: