From: Kent Overstreet Date: Sat, 24 May 2025 01:59:12 +0000 (-0400) Subject: bcachefs: Don't mount bs > ps without TRANSPARENT_HUGEPAGE X-Git-Tag: block-6.16-20250606~39^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9caea9208fc3fbdbd4a41a2de8c6a0c969b030f9;p=linux-block.git bcachefs: Don't mount bs > ps without TRANSPARENT_HUGEPAGE Large folios aren't supported without TRANSPARENT_HUGEPAGE Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 24658bf450ab..11579b74c640 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -950,6 +950,13 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts *opts, bch2_opts_apply(&c->opts, *opts); + if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && + c->opts.block_size > PAGE_SIZE) { + bch_err(c, "cannot mount bs > ps filesystem without CONFIG_TRANSPARENT_HUGEPAGE"); + ret = -EINVAL; + goto err; + } + c->btree_key_cache_btrees |= 1U << BTREE_ID_alloc; if (c->opts.inodes_use_key_cache) c->btree_key_cache_btrees |= 1U << BTREE_ID_inodes;