summaryrefslogtreecommitdiff
path: root/fs/exfat
diff options
context:
space:
mode:
authorSungjong Seo <sj1557.seo@samsung.com>2021-10-19 15:14:21 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-18 14:03:37 +0100
commit284ad310542ffb4e5c2acf11d8a6420b5b7b9cea (patch)
tree82f706dd0358fb617e7744662e3d16542d76b35a /fs/exfat
parent823b487cfbfc80f4accb8e3bad23d02745bcf6f4 (diff)
exfat: fix incorrect loading of i_blocks for large files
commit 0c336d6e33f4bedc443404c89f43c91c8bd9ee11 upstream. 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: 5f2aa075070c ("exfat: add inode operations") Cc: stable@vger.kernel.org # v5.7+ Reported-by: Ganapathi Kamath <hgkamath@hotmail.com> Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/exfat')
-rw-r--r--fs/exfat/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 730373e0965a..8b0288f70e93 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -602,7 +602,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info)
exfat_save_attr(inode, info->attr);
inode->i_blocks = ((i_size_read(inode) + (sbi->cluster_size - 1)) &
- ~(sbi->cluster_size - 1)) >> inode->i_blkbits;
+ ~((loff_t)sbi->cluster_size - 1)) >> inode->i_blkbits;
inode->i_mtime = info->mtime;
inode->i_ctime = info->mtime;
ei->i_crtime = info->crtime;