summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-03-11 21:46:23 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2021-11-04 12:24:57 -0400
commit0f7177822dcd8ba9bb5ac5296f333743f7e7bf8d (patch)
tree499d8fbb77b8eef4b4b57663c52ee22a1c8a4aa5
parent82f3a392da5639109ea3bf81a25eee72e9d5723d (diff)
bcachefs: Fix an allocator startup race
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index e43f7790094a..c8ed2e00a1df 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1169,6 +1169,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);