btrfs-progs: fix wrong extent buffer size when reading tree block
diff mbox

Message ID 4C3C2F4C.6030402@cn.fujitsu.com
State New, archived
Headers show

Commit Message

Miao Xie July 13, 2010, 9:18 a.m. UTC
None

Patch
diff mbox

diff --git a/debug-tree.c b/debug-tree.c
index 40628e0..cf637ab 100644
--- a/debug-tree.c
+++ b/debug-tree.c
@@ -208,7 +208,9 @@  again:
 			read_extent_buffer(leaf, &ri, offset, sizeof(ri));
 			buf = read_tree_block(tree_root_scan,
 					      btrfs_root_bytenr(&ri),
-					      tree_root_scan->leafsize, 0);
+					      btrfs_level_size(tree_root_scan,
+							btrfs_root_level(&ri)),
+					      0);
 			switch(found_key.objectid) {
 			case BTRFS_ROOT_TREE_OBJECTID:
 				if (!skip)