summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-09-25 22:26:48 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2022-10-03 23:55:28 -0400
commit839544067f558288395439454909d0d059c012ed (patch)
tree71ec312a0fd38fc9972bf2d31cc6833c523d5892
parent859a661051acdec8b5bc9b026f916cdd1c15be6f (diff)
bcachefs: Run bch2_fs_counters_init() earlier
We need counters to be initialized before initializing shrinkers - the shrinker callbacks will update those counters. This fixes a segfault in userspace. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 3ee6545a8721..ee31c61fe850 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -785,7 +785,8 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
goto err;
}
- ret = bch2_io_clock_init(&c->io_clock[READ]) ?:
+ ret = bch2_fs_counters_init(c) ?:
+ bch2_io_clock_init(&c->io_clock[READ]) ?:
bch2_io_clock_init(&c->io_clock[WRITE]) ?:
bch2_fs_journal_init(&c->journal) ?:
bch2_fs_replicas_init(c) ?:
@@ -799,8 +800,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
bch2_fs_encryption_init(c) ?:
bch2_fs_compress_init(c) ?:
bch2_fs_ec_init(c) ?:
- bch2_fs_fsio_init(c) ?:
- bch2_fs_counters_init(c);
+ bch2_fs_fsio_init(c);
if (ret)
goto err;