diff options
author | Chao Yu <chao@kernel.org> | 2023-01-31 15:47:00 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-02-02 22:37:17 +0100 |
commit | 8c0ed062ce27f6b7f0a568cb241e2b4dd2d9e6a6 (patch) | |
tree | f09c800cf5c13fefb26fad485d3fb4079ab14bfd /fs/f2fs | |
parent | f2fs: fix to avoid potential memory corruption in __update_iostat_latency() (diff) | |
download | linux-8c0ed062ce27f6b7f0a568cb241e2b4dd2d9e6a6.tar.xz linux-8c0ed062ce27f6b7f0a568cb241e2b4dd2d9e6a6.zip |
f2fs: fix to update age extent correctly during truncation
nr_free may be less than len, we should update age extent cache
w/ range [fofs, len] rather than [fofs, nr_free].
Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f05148a9dc99..a83117325b87 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -617,7 +617,7 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count) fofs = f2fs_start_bidx_of_node(ofs_of_node(dn->node_page), dn->inode) + ofs; f2fs_update_read_extent_cache_range(dn, fofs, 0, len); - f2fs_update_age_extent_cache_range(dn, fofs, nr_free); + f2fs_update_age_extent_cache_range(dn, fofs, len); dec_valid_block_count(sbi, dn->inode, nr_free); } dn->ofs_in_node = ofs; |