]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hpfs: handle set_blocksize failures
authorChristoph Hellwig <hch@lst.de>
Mon, 11 May 2026 07:16:47 +0000 (09:16 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 21 May 2026 11:39:35 +0000 (13:39 +0200)
hpfs 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-3-hch@lst.de
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/hpfs/super.c

index c16d5d4caeadea5dbea9b0e0440f0feea29aa5cf..8fbdbf0806276c9f4c9d33c86af01efe7d1333ca 100644 (file)
@@ -523,7 +523,8 @@ static int hpfs_fill_super(struct super_block *s, struct fs_context *fc)
        hpfs_lock(s);
 
        /*sbi->sb_mounting = 1;*/
-       sb_set_blocksize(s, 512);
+       if (!sb_set_blocksize(s, 512))
+               goto bail0;
        sbi->sb_fs_size = -1;
        if (!(bootblock = hpfs_map_sector(s, 0, &bh0, 0))) goto bail1;
        if (!(superblock = hpfs_map_sector(s, 16, &bh1, 1))) goto bail2;