bcachefs: fix for unmount hang
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 8 Feb 2019 19:43:53 +0000 (14:43 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:15 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c

index 83b3445cc76fa0a8765f01a555570c924bdef9a8..c44e0417af87c3f5aefcb9512f589c6fe4b65a50 100644 (file)
@@ -1257,7 +1257,8 @@ void bch2_dev_allocator_add(struct bch_fs *c, struct bch_dev *ca)
 
 void bch2_dev_allocator_quiesce(struct bch_fs *c, struct bch_dev *ca)
 {
-       closure_wait_event(&c->freelist_wait, ca->allocator_blocked_full);
+       if (ca->alloc_thread)
+               closure_wait_event(&c->freelist_wait, ca->allocator_blocked_full);
 }
 
 /* stop allocator thread: */