bfs: handle set_blocksize failures

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>
This commit is contained in:
Christoph Hellwig 2026-05-11 09:16:46 +02:00 committed by Christian Brauner
parent ccde023e6a
commit 2430e33809
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View 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)