Skip to content

Commit d191786

Browse files
Fengnan ChangJaegeuk Kim
authored andcommitted
f2fs: fix remove page failed in invalidate compress pages
Since compress inode not a regular file, generic_error_remove_page in f2fs_invalidate_compress_pages will always be failed, set compress inode as a regular file to fix it. Fixes: 6ce19af ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Fengnan Chang <changfengnan@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent bd984c0 commit d191786

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/f2fs/inode.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
516516
} else if (ino == F2FS_COMPRESS_INO(sbi)) {
517517
#ifdef CONFIG_F2FS_FS_COMPRESSION
518518
inode->i_mapping->a_ops = &f2fs_compress_aops;
519+
/*
520+
* generic_error_remove_page only truncates pages of regular
521+
* inode
522+
*/
523+
inode->i_mode |= S_IFREG;
519524
#endif
520525
mapping_set_gfp_mask(inode->i_mapping,
521526
GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE);

0 commit comments

Comments
 (0)