aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs
diff options
context:
space:
mode:
authorOGAWA Hirofumi <[email protected]>2020-08-11 18:36:01 -0700
committerLinus Torvalds <[email protected]>2020-08-12 10:58:01 -0700
commita090a5a7d73f79a9ae2dcc6e60d89bfc6864a65a (patch)
tree28512bf55a2f7984d183e4738b974d1fc7414ba1 /fs
parentVFAT/FAT/MSDOS FILESYSTEM: replace HTTP links with HTTPS ones (diff)
downloadwireguard-linux-a090a5a7d73f79a9ae2dcc6e60d89bfc6864a65a.tar.xz
wireguard-linux-a090a5a7d73f79a9ae2dcc6e60d89bfc6864a65a.zip
fat: fix fat_ra_init() for data clusters == 0
If data clusters == 0, fat_ra_init() calls the ->ent_blocknr() for the cluster beyond ->max_clusters. This checks the limit before initialization to suppress the warning. Reported-by: [email protected] Signed-off-by: OGAWA Hirofumi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fatent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index bbfe18c07417..f7e3304b7802 100644
--- a/fs/fat/fatent.c
+++ b/fs/fat/fatent.c
@@ -657,6 +657,9 @@ static void fat_ra_init(struct super_block *sb, struct fatent_ra *ra,
unsigned long ra_pages = sb->s_bdi->ra_pages;
unsigned int reada_blocks;
+ if (fatent->entry >= ent_limit)
+ return;
+
if (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);
OSZAR »