[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ft85osn6.fsf@mail.parknet.co.jp>
Date: Sun, 30 Aug 2020 09:59:41 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: [PATCH] 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, and should fix it though. Anyway, it is better to
avoid the divide-by-zero Oops.
So this check it.
Signed-off-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc: <stable@...r.kernel.org>
---
fs/fat/fatent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index f7e3304..98a1c4f 100644
--- a/fs/fat/fatent.c 2020-08-30 06:52:47.251564566 +0900
+++ b/fs/fat/fatent.c 2020-08-30 06:54:05.838319213 +0900
@@ -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);
_
--
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Powered by blists - more mailing lists