bcachefs: Fix an allocator startup race
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 12 Mar 2021 02:46:23 +0000 (21:46 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:54 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super.c

index 224c21c3f9f74b3ee2af4a8bc4a8027448b4519e..19399447f3796745d735659cadba846f94a2ddf9 100644 (file)
@@ -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);