]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
qnx4: handle set_blocksize failures
authorChristoph Hellwig <hch@lst.de>
Mon, 11 May 2026 07:16:48 +0000 (09:16 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 21 May 2026 11:39:35 +0000 (13:39 +0200)
qnx4 uses buffer_heads, which don't handle block size > PAGE_SIZE well.
Without this, mounting 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-4-hch@lst.de
Acked-by: Anders Larsen <al@alarsen.net>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/qnx4/inode.c

index 4deb0eeadbdef3a580d57fbe4e8518da0f550cb7..42fcd500fad217cdee34d1376d29f668bceedff6 100644 (file)
@@ -202,7 +202,8 @@ static int qnx4_fill_super(struct super_block *s, struct fs_context *fc)
                return -ENOMEM;
        s->s_fs_info = qs;
 
-       sb_set_blocksize(s, QNX4_BLOCK_SIZE);
+       if (!sb_set_blocksize(s, QNX4_BLOCK_SIZE))
+               return -EINVAL;
 
        s->s_op = &qnx4_sops;
        s->s_magic = QNX4_SUPER_MAGIC;