summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/bcachefs/alloc_background.h4
-rw-r--r--fs/bcachefs/super.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_background.h b/fs/bcachefs/alloc_background.h
index f6b9f27f0713..4f462696b747 100644
--- a/fs/bcachefs/alloc_background.h
+++ b/fs/bcachefs/alloc_background.h
@@ -61,8 +61,10 @@ static inline void bch2_wake_allocator(struct bch_dev *ca)
rcu_read_lock();
p = rcu_dereference(ca->alloc_thread);
- if (p)
+ if (p) {
wake_up_process(p);
+ ca->allocator_state = ALLOCATOR_RUNNING;
+ }
rcu_read_unlock();
}
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index d38e520e0d10..c4799a58ff2c 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -879,6 +879,13 @@ int bch2_fs_start(struct bch_fs *c)
set_bit(BCH_FS_STARTED, &c->flags);
+ /*
+ * Allocator threads don't start filling copygc reserve until after we
+ * set BCH_FS_STARTED - wake them now:
+ */
+ for_each_online_member(ca, c, i)
+ bch2_wake_allocator(ca);
+
if (c->opts.read_only || c->opts.nochanges) {
bch2_fs_read_only(c);
} else {