Commit graph

5 commits

Author SHA1 Message Date
Qu Wenruo a5d136b540 btrfs-progs: qgroup-verify: use fs_info::readonly to check if we should repair qgroups
In fact qgroup-verify is just kind of offline qgroup rescan, and later
mkfs qgroup support will reuse it.

So qgroup-verify doesn't really need to rely the global variable @repair
to check if it should repair qgroups.

Instead check fs_info->readonly to do the repair.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-28 19:59:55 +02:00
Qu Wenruo b95e7e87bb btrfs-progs: qgroup-verify: also repair qgroup status version
Current kernel only supports qgroup version 1.  Make qgroup-verify to
follow this standard.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-05-28 19:59:55 +02:00
Qu Wenruo b917a4bd93 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>
2020-05-28 19:59:55 +02:00
Marcos Paulo de Souza 59af046fd2 btrfs-progs: qgroup-verify: Remove duplicated message in report_qgroups
Since 1d5b2ad9 ("btrfs-progs: qgroup-verify: Don't treat qgroup
difference as error if the fs hasn't initialized a rescan") a new
message is being printed when the qgroups is incosistent and the rescan
hasn't being executed, so remove the later message send to stderr.

While in this function, simplify the check for a not executed rescan
since !counts.rescan_running and counts.rescan_running == 0 means the
same thing.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-03-31 18:37:36 +02:00
David Sterba 8e68287d88 btrfs-progs: move qgroup-verify.[ch] to check/
The only user of the functionality is in check.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:27:35 +02:00
Renamed from qgroup-verify.c (Browse further)