Skip to content

Commit 0c336d6

Browse files
Sungjong Seonamjaejeon
authored andcommitted
exfat: fix incorrect loading of i_blocks for large files
When calculating i_blocks, there was a mistake that was masked with a 32-bit variable. So i_blocks for files larger than 4 GiB had incorrect values. Mask with a 64-bit variable instead of 32-bit one. Fixes: 5f2aa07 ("exfat: add inode operations") Cc: [email protected] # v5.7+ Reported-by: Ganapathi Kamath <[email protected]> Signed-off-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 8bb7eca commit 0c336d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/exfat/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info)
604604
exfat_save_attr(inode, info->attr);
605605

606606
inode->i_blocks = ((i_size_read(inode) + (sbi->cluster_size - 1)) &
607-
~(sbi->cluster_size - 1)) >> inode->i_blkbits;
607+
~((loff_t)sbi->cluster_size - 1)) >> inode->i_blkbits;
608608
inode->i_mtime = info->mtime;
609609
inode->i_ctime = info->mtime;
610610
ei->i_crtime = info->crtime;

0 commit comments

Comments
 (0)