diff options
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r-- | libbcachefs/alloc_background.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c index 2552d457..ce42202f 100644 --- a/libbcachefs/alloc_background.c +++ b/libbcachefs/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: */ @@ -1534,6 +1535,8 @@ int bch2_fs_allocator_start(struct bch_fs *c) } } + set_bit(BCH_FS_ALLOCATOR_RUNNING, &c->flags); + return bch2_alloc_write(c, false, &wrote); } |