omfs: handle set_blocksize failures

omfs 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>

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260511071701.2456211-11-hch@lst.de
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christoph Hellwig authored and Christian Brauner committed 2026-05-21 13:39:36 +02:00
1 parent 24f7d1824b
commit 18c3d6fcb5
1 file changed
+4 -2
+4 -2
View File
@@ -478,7 +478,8 @@ static int omfs_fill_super(struct super_block *sb, struct fs_context *fc)
sb->s_time_min = 0;
sb->s_time_max = U64_MAX / MSEC_PER_SEC;
sb_set_blocksize(sb, 0x200);
if (!sb_set_blocksize(sb, 0x200))
goto end;
bh = sb_bread(sb, 0);
if (!bh)
@@ -530,7 +531,8 @@ static int omfs_fill_super(struct super_block *sb, struct fs_context *fc)
* Use sys_blocksize as the fs block since it is smaller than a
* page while the fs blocksize can be larger.
*/
sb_set_blocksize(sb, sbi->s_sys_blocksize);
if (!sb_set_blocksize(sb, sbi->s_sys_blocksize))
goto out_brelse_bh;
/*
* ...and the difference goes into a shift. sys_blocksize is always