All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] exfat: fix incorrect loading of i_blocks for large files
       [not found] <CGME20211019061448epcas1p1c6951207ef0ba73f1ef17862bb4495ff@epcas1p1.samsung.com>
@ 2021-10-19  6:14 ` Sungjong Seo
  2021-10-20  1:20   ` Namjae Jeon
  0 siblings, 1 reply; 2+ messages in thread
From: Sungjong Seo @ 2021-10-19  6:14 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: stable, linkinjeon, sj1557.seo

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>
---
v2:
 - Fix maximum 75 characters warning from checkpatch.pl.

 fs/exfat/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index ca37d4344361..1c7aa1ea4724 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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] exfat: fix incorrect loading of i_blocks for large files
  2021-10-19  6:14 ` [PATCH v2] exfat: fix incorrect loading of i_blocks for large files Sungjong Seo
@ 2021-10-20  1:20   ` Namjae Jeon
  0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2021-10-20  1:20 UTC (permalink / raw)
  To: Sungjong Seo; +Cc: linux-fsdevel, stable

2021-10-19 15:14 GMT+09:00, Sungjong Seo <sj1557.seo@samsung.com>:
> 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>
Applied, Thanks for your patch!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-20  1:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20211019061448epcas1p1c6951207ef0ba73f1ef17862bb4495ff@epcas1p1.samsung.com>
2021-10-19  6:14 ` [PATCH v2] exfat: fix incorrect loading of i_blocks for large files Sungjong Seo
2021-10-20  1:20   ` Namjae Jeon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.