]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
minix: handle set_blocksize failures
authorChristoph Hellwig <hch@lst.de>
Mon, 11 May 2026 07:16:53 +0000 (09:16 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 21 May 2026 11:39:36 +0000 (13:39 +0200)
minix uses buffer_heads, which don't handle block size > PAGE_SIZE well.
Without this, mounting we will hit the

        BUG_ON(offset >= folio_size(folio));

in folio_set_bh on the first __bread_gfp call.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260511071701.2456211-9-hch@lst.de
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/minix/inode.c

index 9c6bac24890772f22ad3d087234057375f92235a..03a69b13950db9bca12ccf15e3bef2bd2b1cd31d 100644 (file)
@@ -292,7 +292,8 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc)
                sbi->s_namelen = 60;
                sbi->s_version = MINIX_V3;
                sbi->s_mount_state = MINIX_VALID_FS;
-               sb_set_blocksize(s, m3s->s_blocksize);
+               if (!sb_set_blocksize(s, m3s->s_blocksize))
+                       goto out;
                s->s_max_links = MINIX2_LINK_MAX;
        } else
                goto out_no_fs;