From 3ec3758a814840619ceb3446a37501cfca29bdae Mon Sep 17 00:00:00 2001 From: Daniel Hill Date: Tue, 28 Nov 2023 19:24:47 +1300 Subject: [PATCH] bcachefs: copygc should wakeup on shutdown if disabled Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet --- fs/bcachefs/movinggc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index dcb163a68e47b..7155e2060d29e 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -337,7 +337,8 @@ static int bch2_copygc_thread(void *arg) if (!c->copy_gc_enabled) { move_buckets_wait(&ctxt, buckets, true); - kthread_wait_freezable(c->copy_gc_enabled); + kthread_wait_freezable(c->copy_gc_enabled || + kthread_should_stop()); } if (unlikely(freezing(current))) { -- 2.30.2