Commit 078e9a1cc973 ("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 <w...@suse.com>
---
 qgroup-verify.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qgroup-verify.c b/qgroup-verify.c
index f5885589f02c..9b509abb78fd 100644
--- a/qgroup-verify.c
+++ b/qgroup-verify.c
@@ -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;
 
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to