diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 2ab3b424735a..1d85f1e58d32 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -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) ||