Re: [PATCH] jfs: check sb_set_blocksize() return value in jfs_fill_super()

From: Christian Brauner

Date: Fri May 15 2026 - 09:30:12 EST


On Thu, May 14, 2026 at 04:07:00PM +0000, Daiki Harada wrote:
> jfs_fill_super() does not check the return value of sb_set_blocksize().
> If the block device's logical block size exceeds PAGE_SIZE,
> sb_set_blocksize() fails and returns 0, but jfs_fill_super() continues
> regardless. Subsequent sb_bread() calls then trigger a BUG() in
> folio_alloc_buffers() because the block size is incompatible with the
> folio size.
>
> Fix by checking the return value of sb_set_blocksize() and failing the
> mount with -EINVAL if it returns 0.
>
> Reported-by: syzbot+32ec8b5bd050c78741c2@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=32ec8b5bd050c78741c2
> Signed-off-by: Daiki Harada <daiky0325@xxxxxxxxx>

I already have a series from Christoph in my tree that fixes all
instances of this bug. Thank you for the fix though!