summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-05-11 10:16:50 +0300
committerChristian Brauner <brauner@kernel.org>2026-05-21 14:39:35 +0300
commit7597d42a25332617a3dfe596758d780ec6c028d7 (patch)
treea269a990216cca394e74275bf36603e9d222dfac
parent05107f5602751fcfd3d108c1f579eb45aabead52 (diff)
downloadlinux-7597d42a25332617a3dfe596758d780ec6c028d7.tar.xz
befs: handle set_blocksize failures
befs 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-6-hch@lst.de Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
-rw-r--r--fs/befs/linuxvfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index c12caae9a967..ee0cbae521b9 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -860,7 +860,8 @@ befs_fill_super(struct super_block *sb, struct fs_context *fc)
*/
sb->s_magic = BEFS_SUPER_MAGIC;
/* Set real blocksize of fs */
- sb_set_blocksize(sb, (ulong) befs_sb->block_size);
+ if (!sb_set_blocksize(sb, (ulong) befs_sb->block_size))
+ goto unacquire_priv_sbp;
sb->s_op = &befs_sops;
sb->s_export_op = &befs_export_operations;
sb->s_time_min = 0;