From ca2e7a3de895c703d2cbbd9b63c10d8adfba8228 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 16 Dec 2024 16:41:25 -0500 Subject: [PATCH 233/233] bcachefs: Fix assert for online fsck Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit We can't check if we're racing with fsck ending until mark_lock is held. Signed-off-by: Kent Overstreet Signed-off-by: Alexander Miroshnichenko --- fs/bcachefs/disk_accounting.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/disk_accounting.h b/fs/bcachefs/disk_accounting.h index fc1b673689c8..5360cbb3ec29 100644 --- a/fs/bcachefs/disk_accounting.h +++ b/fs/bcachefs/disk_accounting.h @@ -138,7 +138,8 @@ static inline int bch2_accounting_mem_mod_locked(struct btree_trans *trans, bpos_to_disk_accounting_pos(&acc_k, a.k->p); bool gc = mode == BCH_ACCOUNTING_gc; - EBUG_ON(gc && !acc->gc_running); + if (gc && !acc->gc_running) + return 0; if (!bch2_accounting_is_mem(acc_k)) return 0; -- 2.45.2