Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

f2fs: fix to avoid overflow while left shift operation

Should cast type of folio->index from pgoff_t to loff_t to avoid overflow
while left shift operation.

Fixes: 3265d3db1f16 ("f2fs: support partial truncation on compressed inode")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
0fe1c6be 1bd119da

+1 -1
+1 -1
fs/f2fs/compress.c
··· 1245 1245 1246 1246 for (i = cluster_size - 1; i >= 0; i--) { 1247 1247 struct folio *folio = page_folio(rpages[i]); 1248 - loff_t start = folio->index << PAGE_SHIFT; 1248 + loff_t start = (loff_t)folio->index << PAGE_SHIFT; 1249 1249 1250 1250 if (from <= start) { 1251 1251 folio_zero_segment(folio, 0, folio_size(folio));