aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-05-25 18:42:05 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:04 -0400
commitc4d4b2f01abd95af7c6dccf236e2760aef5a9b69 (patch)
tree064a769a536a115afe5f5272bd7ec1ecc4234b68 /fs/bcachefs
parent443d2760e51f3e17ddb47ddaf969ba49e6dbd06d (diff)
bcachefs: Add a cond_resched call to the copygc main loop
We seem to have a bug where the copygc thread ends up spinning and making the system unusable - this will at least prevent it from locking up the machine, and it's a good thing to have anyways. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/movinggc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index acb4d943db79..e8f9d70af930 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -317,6 +317,8 @@ static int bch2_copygc_thread(void *arg)
set_freezable();
while (!kthread_should_stop()) {
+ cond_resched();
+
if (kthread_wait_freezable(c->copy_gc_enabled))
break;