Re: [PATCH 01/10] bfs: handle set_blocksize failures

Jan Kara <[email protected]> Mon, 11 May 2026 18:10:58 +0200
Newsgroups dev.linux.lists.ntfs3,org.kernel.vger.linux-fsdevel
Message-ID <xhrhv2me7xqmem6x3u4aoh2crkdveencprsoovpy2yuj6npos3@tu325ohquuyj>
On Mon 11-05-26 09:16:46, Christoph Hellwig wrote:
> 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 <[email protected]>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

								Honza

> ---
>  fs/bfs/inode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
> index 19e49c8cf750..9c3e90390824 100644
> --- a/fs/bfs/inode.c
> +++ b/fs/bfs/inode.c
> @@ -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)
> -- 
> 2.53.0
> 
-- 
Jan Kara <[email protected]>
SUSE Labs, CR