Commit 01254036 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs; Check for allocator thread shutdown

We were missing a kthread_should_stop() check in the loop in
bch2_invalidate_buckets(), very occasionally leading to us getting stuck
while shutting down.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent d7fc453b
......@@ -836,6 +836,11 @@ static int bch2_invalidate_buckets(struct bch_fs *c, struct bch_dev *ca)
while (!ret &&
!fifo_full(&ca->free_inc) &&
ca->alloc_heap.used) {
if (kthread_should_stop()) {
ret = 1;
break;
}
ret = bch2_invalidate_one_bucket(c, ca, &journal_seq,
(!fifo_empty(&ca->free_inc)
? BTREE_INSERT_NOWAIT : 0));
......
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