[v4,03/11] btrfs-progs: qgroup-verify: Use fs_info->readonly to check if we should repair qgroups
diff mbox series

Message ID 20200318202148.14828-4-marcos@mpdesouza.com
State New
Headers show
Series
  • btrfs-progs: mkfs: Quota support through -Q|--quota
Related show

Commit Message

Marcos Paulo de Souza March 18, 2020, 8:21 p.m. UTC
From: Qu Wenruo <wqu@suse.com>

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>
---
 check/qgroup-verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c
index 0509ecec..b7b63095 100644
--- a/check/qgroup-verify.c
+++ b/check/qgroup-verify.c
@@ -1617,7 +1617,7 @@  int repair_qgroups(struct btrfs_fs_info *info, int *repaired)
 
 	*repaired = 0;
 
-	if (!repair)
+	if (info->readonly)
 		return 0;
 
 	list_for_each_entry_safe(count, tmpcount, &bad_qgroups, bad_list) {