Skip to content

Commit 03aa12a

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: 1b6138385499 ("exfat: reduce block requests when zeroing a cluster") 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 d7cd524 commit 03aa12a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fatent.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
278278
struct super_block *sb = dir->i_sb;
279279
struct exfat_sb_info *sbi = EXFAT_SB(sb);
280280
struct buffer_head *bh;
281-
sector_t blknr, last_blknr;
282-
int i;
281+
sector_t blknr, last_blknr, i;
283282

284283
blknr = exfat_cluster_to_sector(sbi, clu);
285284
last_blknr = blknr + sbi->sect_per_clus;

0 commit comments

Comments
 (0)