diff mbox series

[v4,02/11] btrfs-progs: qgroup-verify: Also repair qgroup status version

Message ID 20200318202148.14828-3-marcos@mpdesouza.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: mkfs: Quota support through -Q|--quota | expand

Commit Message

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

Current kernel only supports qgroup version 1.
Make qgroup-verify to follow this standard.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check/qgroup-verify.c | 2 ++
 ctree.h               | 1 +
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c
index 17c266d4..0509ecec 100644
--- a/check/qgroup-verify.c
+++ b/check/qgroup-verify.c
@@ -1598,6 +1598,8 @@  static int repair_qgroup_status(struct btrfs_fs_info *info)
 	btrfs_set_qgroup_status_rescan(path.nodes[0], status_item, 0);
 	btrfs_set_qgroup_status_generation(path.nodes[0], status_item,
 					   trans->transid);
+	btrfs_set_qgroup_status_version(path.nodes[0], status_item,
+					BTRFS_QGROUP_STATUS_VERSION);
 
 	btrfs_mark_buffer_dirty(path.nodes[0]);
 
diff --git a/ctree.h b/ctree.h
index 36f62732..083bde3c 100644
--- a/ctree.h
+++ b/ctree.h
@@ -1034,6 +1034,7 @@  struct btrfs_qgroup_status_item {
 	__le64 rescan;		/* progress during scanning */
 } __attribute__ ((__packed__));
 
+#define BTRFS_QGROUP_STATUS_VERSION		1
 struct btrfs_block_group_item {
 	__le64 used;
 	__le64 chunk_objectid;