mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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: 3265d3db1f ("f2fs: support partial truncation on compressed inode")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
1bd119da0b
commit
0fe1c6bec5
|
|
@ -1245,7 +1245,7 @@ int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock)
|
|||
|
||||
for (i = cluster_size - 1; i >= 0; i--) {
|
||||
struct folio *folio = page_folio(rpages[i]);
|
||||
loff_t start = folio->index << PAGE_SHIFT;
|
||||
loff_t start = (loff_t)folio->index << PAGE_SHIFT;
|
||||
|
||||
if (from <= start) {
|
||||
folio_zero_segment(folio, 0, folio_size(folio));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user