* + fat-avoid-oops-when-bdi-io_pages==0.patch added to -mm tree
@ 2020-08-30 20:30 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-08-30 20:30 UTC (permalink / raw)
To: mm-commits, willy, stable, axboe, hirofumi
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@mail.parknet.co.jp>
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@mail.parknet.co.jp
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org> [5.8+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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@mail.parknet.co.jp are
fat-avoid-oops-when-bdi-io_pages==0.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-30 20:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-30 20:30 + fat-avoid-oops-when-bdi-io_pages==0.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).