diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-09-18 19:33:12 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2019-09-18 19:33:12 -0400 |
commit | 7331c47ba71fd60a1728f30f290d8d5556f2924c (patch) | |
tree | 9f9f74df340ac9ad5c9f20a898b6570df9e9b414 | |
parent | 0de04797ddbcdfe8dad910ce092901ce6884a364 (diff) |
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 <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/alloc_background.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 7a457729cf18..9814179a6406 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); |