From 3d870a491fc81a2ca8fe2ce092858f64c19a9240 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 23 Aug 2021 16:14:51 -0400 Subject: [PATCH] btrfs-progs: make sure track_dirty and ref_cows is set properly 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 Signed-off-by: David Sterba --- 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 8b6f5ef7..0dc31c36 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -705,7 +705,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; }