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

index 19e49c8cf7505621ddcbe435b67c9deb3e544431..9c3e90390824c3648b93c2d2075354773fe0809e 100644 (file)
@@ -346,7 +346,8 @@ static int bfs_fill_super(struct super_block *s, struct fs_context *fc)
        s->s_time_min = 0;
        s->s_time_max = U32_MAX;
 
-       sb_set_blocksize(s, BFS_BSIZE);
+       if (!sb_set_blocksize(s, BFS_BSIZE))
+               goto out;
 
        sbh = sb_bread(s, 0);
        if (!sbh)