From db7157d912a3142ee82fdeb16ce730a1399e1d72 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 23 Aug 2023 10:27:49 -0400 Subject: [PATCH] btrfs-progs: clear root dirty when we update the root We don't currently use the bit to track whether or not the root is dirty, but when we sync ctree.c it uses this bit to determine if we should add the root to the dirty list. Clear this bit when we update the root so that the dirty tracking works properly when we sync ctree.c. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- kernel-shared/transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel-shared/transaction.c b/kernel-shared/transaction.c index d30be5b5..d5b349e4 100644 --- a/kernel-shared/transaction.c +++ b/kernel-shared/transaction.c @@ -15,6 +15,7 @@ */ #include "kerncompat.h" +#include "kernel-lib/bitops.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" #include "kernel-shared/delayed-ref.h" @@ -119,6 +120,7 @@ int commit_tree_roots(struct btrfs_trans_handle *trans, next = fs_info->dirty_cowonly_roots.next; list_del_init(next); root = list_entry(next, struct btrfs_root, dirty_list); + clear_bit(BTRFS_ROOT_DIRTY, &root->state); ret = update_cowonly_root(trans, root); free_extent_buffer(root->commit_root); root->commit_root = NULL;