bcachefs: Fix an allocator startup race

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2021-03-11 21:46:23 -05:00 committed by Kent Overstreet
parent e01dacf76c
commit 220d206232

View 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);