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

index 61575f7397aea2b45268783c59af65996a85076e..8180d83d33fed5479046479041c43e05d9b8ca50 100644 (file)
@@ -491,7 +491,8 @@ static int jfs_fill_super(struct super_block *sb, struct fs_context *fc)
        /*
         * Initialize blocksize to 4K.
         */
-       sb_set_blocksize(sb, PSIZE);
+       if (!sb_set_blocksize(sb, PSIZE))
+               goto out_unload;
 
        /*
         * Set method vectors.