bcachefs: Don't mount bs > ps without TRANSPARENT_HUGEPAGE
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 24 May 2025 01:59:12 +0000 (21:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 24 May 2025 02:00:07 +0000 (22:00 -0400)
Large folios aren't supported without TRANSPARENT_HUGEPAGE

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super.c

index 24658bf450ab9df01fa517013d3b74faf4b81337..11579b74c64003d33cca9f660f60b0499d109d4f 100644 (file)
@@ -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;