bcachefs: copygc should wakeup on shutdown if disabled
authorDaniel Hill <daniel@gluo.nz>
Tue, 28 Nov 2023 06:24:47 +0000 (19:24 +1300)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:39 +0000 (11:47 -0500)
Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/movinggc.c

index dcb163a68e47bc69ee75eab9b0999fdf9faaae1a..7155e2060d29e0174f556dbdf2a4e956ce335393 100644 (file)
@@ -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))) {