]> git.dujemihanovic.xyz Git - linux.git/commitdiff
bcachefs: Fix trans_commit disk accounting revert
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 3 Oct 2024 01:35:38 +0000 (21:35 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 3 Oct 2024 01:37:42 +0000 (21:37 -0400)
We only are applying JSET_ENTRY_TYPE_write_buffer_keys, revert path was
missed.

Fixes: a3581ca35d2b ("bcachefs: Fix BCH_TRANS_COMMIT_skip_accounting_apply")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_trans_commit.c

index 1a74a1a252ee2384b6b35d8a120549d17fe0e697..9bf471fa4361405b21fd57faed5a82296fef9374 100644 (file)
@@ -832,7 +832,8 @@ revert_fs_usage:
        for (struct jset_entry *entry2 = trans->journal_entries;
             entry2 != entry;
             entry2 = vstruct_next(entry2))
-               if (jset_entry_is_key(entry2) && entry2->start->k.type == KEY_TYPE_accounting) {
+               if (entry2->type == BCH_JSET_ENTRY_write_buffer_keys &&
+                   entry2->start->k.type == KEY_TYPE_accounting) {
                        struct bkey_s_accounting a = bkey_i_to_s_accounting(entry2->start);
 
                        bch2_accounting_neg(a);