From: Kent Overstreet Date: Sat, 25 May 2024 04:53:25 +0000 (-0400) Subject: bcachefs: Fix debug assert X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d509cadc3a48fee394d68757e4b685f7c143ed64;p=linux.git bcachefs: Fix debug assert Reported-by: syzbot+a8074a75b8d73328751e@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 2206a8dee693a..df2bea38e83f0 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -564,7 +564,7 @@ static void __bch2_fs_free(struct bch_fs *c) BUG_ON(atomic_read(&c->journal_keys.ref)); bch2_fs_btree_write_buffer_exit(c); percpu_free_rwsem(&c->mark_lock); - EBUG_ON(percpu_u64_get(c->online_reserved)); + EBUG_ON(c->online_reserved && percpu_u64_get(c->online_reserved)); free_percpu(c->online_reserved); darray_exit(&c->btree_roots_extra);