The patch titled Subject: fat: avoid oops when bdi->io_pages==0 has been added to the -mm tree. Its filename is fat-avoid-oops-when-bdi-io_pages==0.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fat-avoid-oops-when-bdi-io_pages%3D%3D0.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fat-avoid-oops-when-bdi-io_pages%3D%3D0.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> Subject: fat: avoid oops when bdi->io_pages==0 On one system, there was bdi->io_pages==0. This seems to be the bug of a driver somewhere, which perhaps failed to initialize io_pages. We should fix it though - it is better to avoid the divide-by-zero Oops. So add a check for this. Link: http://lkml.kernel.org/r/87ft85osn6.fsf@xxxxxxxxxxxxxxxxxx Signed-off-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> [5.8+] Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/fat/fatent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/fat/fatent.c~fat-avoid-oops-when-bdi-io_pages==0 +++ a/fs/fat/fatent.c @@ -660,7 +660,7 @@ static void fat_ra_init(struct super_blo if (fatent->entry >= ent_limit) return; - if (ra_pages > sb->s_bdi->io_pages) + if (sb->s_bdi->io_pages && ra_pages > sb->s_bdi->io_pages) ra_pages = rounddown(ra_pages, sb->s_bdi->io_pages); reada_blocks = ra_pages << (PAGE_SHIFT - sb->s_blocksize_bits + 1); _ Patches currently in -mm which might be from hirofumi@xxxxxxxxxxxxxxxxxx are fat-avoid-oops-when-bdi-io_pages==0.patch