From: Sungjong Seo Date: Tue, 19 Oct 2021 06:14:21 +0000 (+0900) Subject: exfat: fix incorrect loading of i_blocks for large files X-Git-Tag: accepted/tizen/unified/20230118.172025~6039 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e119d7ef5f92cdb371d25a16c8a0c6cf970765cc;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Sungjong Seo Signed-off-by: Namjae Jeon Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index ca37d43..1c7aa1e 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -604,7 +604,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;