|
Kmods SIG |
50e2b3 |
From 0c336d6e33f4bedc443404c89f43c91c8bd9ee11 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
50e2b3 |
From: Sungjong Seo <sj1557.seo@samsung.com>
|
|
Kmods SIG |
50e2b3 |
Date: Tue, 19 Oct 2021 15:14:21 +0900
|
|
Kmods SIG |
50e2b3 |
Subject: [Backport 0c336d6e33f4] exfat: fix incorrect loading of i_blocks for
|
|
Kmods SIG |
50e2b3 |
large files
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
When calculating i_blocks, there was a mistake that was masked with a
|
|
Kmods SIG |
50e2b3 |
32-bit variable. So i_blocks for files larger than 4 GiB had incorrect
|
|
Kmods SIG |
50e2b3 |
values. Mask with a 64-bit variable instead of 32-bit one.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Fixes: 5f2aa075070c ("exfat: add inode operations")
|
|
Kmods SIG |
50e2b3 |
Cc: stable@vger.kernel.org # v5.7+
|
|
Kmods SIG |
50e2b3 |
Reported-by: Ganapathi Kamath <hgkamath@hotmail.com>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
|
|
Kmods SIG |
50e2b3 |
---
|
|
Kmods SIG |
50e2b3 |
src/inode.c | 2 +-
|
|
Kmods SIG |
50e2b3 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/inode.c b/src/inode.c
|
|
Kmods SIG |
50e2b3 |
index ca37d43443612c61200b07b69e40993ea0eff8d2..1c7aa1ea4724cf03e49daef0e730dc620200088f 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/inode.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/inode.c
|
|
Kmods SIG |
50e2b3 |
@@ -604,7 +604,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info)
|
|
Kmods SIG |
50e2b3 |
exfat_save_attr(inode, info->attr);
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
inode->i_blocks = ((i_size_read(inode) + (sbi->cluster_size - 1)) &
|
|
Kmods SIG |
50e2b3 |
- ~(sbi->cluster_size - 1)) >> inode->i_blkbits;
|
|
Kmods SIG |
50e2b3 |
+ ~((loff_t)sbi->cluster_size - 1)) >> inode->i_blkbits;
|
|
Kmods SIG |
50e2b3 |
inode->i_mtime = info->mtime;
|
|
Kmods SIG |
50e2b3 |
inode->i_ctime = info->mtime;
|
|
Kmods SIG |
50e2b3 |
ei->i_crtime = info->crtime;
|
|
Kmods SIG |
50e2b3 |
--
|
|
Kmods SIG |
50e2b3 |
2.31.1
|
|
Kmods SIG |
50e2b3 |
|