[PATCH v2 06/10] btrfs-progs: make sure track_dirty and ref_cows is set properly
From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-08-23 20:15:09
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-08-23 20:15:09
Subsystem:
the rest · Maintainer:
Linus Torvalds
Adding support for the per-block group roots means we will be reading the roots directly in different places. Make sure we set ->track_dirty and ->ref_cows properly in the helper so we don't have to do this everywhere. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/disk-io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index 84990a52..7f99fc8d 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c@@ -720,7 +720,10 @@ out: return ERR_PTR(-EIO); } insert: - root->ref_cows = 1; + if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) + root->track_dirty = 1; + if (is_fstree(root->root_key.objectid)) + root->ref_cows = 1; return root; }
--
2.26.3