Commit 4d13e818 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Avoid deadlocking on the allocator

The allocator needs to make sure there's buckets available on the
RESERVE_NONE freelist if at all possible - otherwise foreground IO will
get stuck.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f4b61341
......@@ -1164,7 +1164,7 @@ static int bch2_allocator_thread(void *arg)
*/
if (!nr ||
(nr < ALLOC_SCAN_BATCH(ca) &&
!fifo_full(&ca->free[RESERVE_MOVINGGC]))) {
!fifo_empty(&ca->free[RESERVE_NONE]))) {
ret = wait_buckets_available(c, ca);
if (ret) {
up_read(&c->gc_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment