btrfs-progs: qgroup-verify: avoid NULL pointer dereference for later silent qgroup repair
Commit 078e9a1cc9
("btrfs-progs: check: enhanced progress indicator")
introduced @qgroup_item_count for progress indicator.
However since we will later introduce silent qgroup rescan
functionality, the @qgroup_item_count pointer can be NULL.
So check if @qgroup_item_count is NULL before accessing it.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2df82a2da6
commit
b917a4bd93
|
@ -743,7 +743,8 @@ static int travel_tree(struct btrfs_fs_info *info, struct btrfs_root *root,
|
|||
*/
|
||||
nr = btrfs_header_nritems(eb);
|
||||
for (i = 0; i < nr; i++) {
|
||||
(*qgroup_item_count)++;
|
||||
if (qgroup_item_count)
|
||||
(*qgroup_item_count)++;
|
||||
new_bytenr = btrfs_node_blockptr(eb, i);
|
||||
new_num_bytes = info->nodesize;
|
||||
|
||||
|
|
Loading…
Reference in New Issue