From: Kent Overstreet Date: Fri, 12 Mar 2021 02:46:23 +0000 (-0500) Subject: bcachefs: Fix an allocator startup race X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=220d206232ba682002b06feb68969e462867f8f5;p=linux.git bcachefs: Fix an allocator startup race Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 224c21c3f9f74..19399447f3796 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);