From: Kent Overstreet Date: Wed, 18 Sep 2019 23:33:12 +0000 (-0400) Subject: bcachefs: Avoid deadlocking on the allocator X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4d13e818f5c00ae064aefba8349383cc2d79bf6d;p=linux.git 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: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 54051161eba76..85795b580892d 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -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);