diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 93ee5cdfbe35..98dd4995e528 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1104,6 +1104,8 @@ static int bch2_allocator_thread(void *arg) while (1) { cond_resched(); + if (kthread_should_stop()) + break; pr_debug("discarding %zu invalidated buckets", fifo_used(&ca->free_inc));