From: Kent Overstreet Date: Mon, 16 Dec 2024 21:41:25 +0000 (-0500) Subject: bcachefs: Fix assert for online fsck X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fa3e5135e4e7bfb38598a58caf592c940eff4b03;p=users%2Fdwmw2%2Flinux.git bcachefs: Fix assert for online fsck We can't check if we're racing with fsck ending until mark_lock is held. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/disk_accounting.h b/fs/bcachefs/disk_accounting.h index fc1b673689c80..5360cbb3ec298 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;