Skip to content

Commit

Permalink
f2fs: remove redunant invalidate compress pages
Browse files Browse the repository at this point in the history
Compress page will invalidate in truncate block process too, so remove
redunant invalidate compress pages in f2fs_evict_inode.

Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Fengnan Chang authored and Jaegeuk Kim committed Jan 4, 2022
1 parent d361b69 commit 2b64289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/f2fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,8 @@ void f2fs_evict_inode(struct inode *inode)
trace_f2fs_evict_inode(inode);
truncate_inode_pages_final(&inode->i_data);

if (test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode))
if ((inode->i_nlink || is_bad_inode(inode)) &&
test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode))
f2fs_invalidate_compress_pages(sbi, inode->i_ino);

if (inode->i_ino == F2FS_NODE_INO(sbi) ||
Expand Down

0 comments on commit 2b64289

Please sign in to comment.