btrfs-progs: fix wrong extent buffer size when reading tree block
the root extent buffer of a tree may not be a leaf, so we must get the right size by its level when reading it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
4e64e05c6b
commit
b4d668ee6b
|
@ -212,7 +212,9 @@ again:
|
||||||
read_extent_buffer(leaf, &ri, offset, sizeof(ri));
|
read_extent_buffer(leaf, &ri, offset, sizeof(ri));
|
||||||
buf = read_tree_block(tree_root_scan,
|
buf = read_tree_block(tree_root_scan,
|
||||||
btrfs_root_bytenr(&ri),
|
btrfs_root_bytenr(&ri),
|
||||||
tree_root_scan->leafsize, 0);
|
btrfs_level_size(tree_root_scan,
|
||||||
|
btrfs_root_level(&ri)),
|
||||||
|
0);
|
||||||
switch(found_key.objectid) {
|
switch(found_key.objectid) {
|
||||||
case BTRFS_ROOT_TREE_OBJECTID:
|
case BTRFS_ROOT_TREE_OBJECTID:
|
||||||
if (!skip)
|
if (!skip)
|
||||||
|
|
Loading…
Reference in New Issue