summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-02-08 14:43:53 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2019-04-03 12:44:04 -0400
commit1f8e8786d46f6f18dfc29a30793c5749c38d3372 (patch)
treea90be478f3adcb5eb3a018c1fb004d6fdcea0eac
parentd5db14b026502c0eb441d87e8195c0941aedab3b (diff)
bcachefs: fix for unmount hang
-rw-r--r--fs/bcachefs/alloc_background.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index e9a91617da9d..ce42202fdd14 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1256,7 +1256,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: */