btrfs-progs: tree-stats: initialize the key properly
I started hitting a segfault on fuzz test 006 because we couldn't find the extent root. This is because the global root search stuff expects the actual key to be setup properly, not just an objectid. Fix this by initializing the key properly so we can find the extent root and other trees properly. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ee21714e21
commit
d1235141ab
|
@ -447,7 +447,7 @@ static const char * const cmd_inspect_tree_stats_usage[] = {
|
|||
static int cmd_inspect_tree_stats(const struct cmd_struct *cmd,
|
||||
int argc, char **argv)
|
||||
{
|
||||
struct btrfs_key key;
|
||||
struct btrfs_key key = { .type = BTRFS_ROOT_ITEM_KEY };
|
||||
struct btrfs_root *root;
|
||||
int opt;
|
||||
int ret = 0;
|
||||
|
|
Loading…
Reference in New Issue