diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-17 18:20:26 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:41 -0400 |
commit | eff508b459fb90682c7a5c4e6d2de0b1d18217e4 (patch) | |
tree | 2abf7b1ce47b17911d9f5f31aa6f0780bcabd02c /fs/bcachefs | |
parent | a34782a0663cc3a5d8c4e4657480fa0e6ddc8a16 (diff) |
bcachefs: Add a kthread_should_stop() check to allocator thread
Turns out it's possible during shutdown for the allocator to get stuck
spinning on bch2_invalidate_buckets() without hitting any of the other
checks.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/alloc_background.c | 2 |
1 files changed, 2 insertions, 0 deletions
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)); |