Skip to content

Commit 2e9ceb6

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: fix overflow for large capacity partition
Using int type for sector index, there will be overflow in a large capacity partition. For example, if storage with sector size of 512 bytes and partition capacity is larger than 2TB, there will be overflow. Fixes: 1b61383 ("exfat: reduce block requests when zeroing a cluster") Cc: [email protected] # v5.19+ Signed-off-by: Yuezhang Mo <[email protected]> Reviewed-by: Andy Wu <[email protected]> Reviewed-by: Aoyama Wataru <[email protected]> Acked-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 4c61282 commit 2e9ceb6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/exfat/fatent.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
270270
struct super_block *sb = dir->i_sb;
271271
struct exfat_sb_info *sbi = EXFAT_SB(sb);
272272
struct buffer_head *bh;
273-
sector_t blknr, last_blknr;
274-
int i;
273+
sector_t blknr, last_blknr, i;
275274

276275
blknr = exfat_cluster_to_sector(sbi, clu);
277276
last_blknr = blknr + sbi->sect_per_clus;

0 commit comments

Comments
 (0)