bcachefs: Fix an allocator shutdown deadlock
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 13 Jul 2021 20:12:00 +0000 (16:12 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:08 +0000 (17:09 -0400)
commit9f6e1f7bb0e136871159a71d2bcd31c5dd8cbe81
tree96aa18224902e9320df210bbafbed5ae576a5909
parent8d3445878166ea726bc24326003ea7b9739cdc00
bcachefs: Fix an allocator shutdown deadlock

On fstest generic/388, we were seeing sporadic deadlocks in the
emergency shutdown, where we'd get stuck shutting down the allocator
because bch2_btree_update_start() -> bch2_btree_reserve_get() allocated
and then deallocated some btree nodes, putting them back on the
btree_reserve_cache, after the allocator shutdown code had already
cleared out that cache.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_interior.c