From 220d206232ba682002b06feb68969e462867f8f5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 11 Mar 2021 21:46:23 -0500 Subject: bcachefs: Fix an allocator startup race Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/super.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/bcachefs/super.c') diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 224c21c3f9f7..19399447f379 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1177,6 +1177,8 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx) if (!ca) goto err; + ca->fs = c; + if (ca->mi.state == BCH_MEMBER_STATE_RW && bch2_dev_allocator_start(ca)) { bch2_dev_free(ca); -- cgit v1.2.3