On 2021/11/24 16:39, Fengnan Chang wrote:
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: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed 
blocks")

Signed-off-by: Fengnan Chang <[email protected]>
---
  fs/f2fs/inode.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 0f8b2df3e1e0..7ea76784efcc 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -516,6 +516,7 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned 
long ino)
        } else if (ino == F2FS_COMPRESS_INO(sbi)) {
  #ifdef CONFIG_F2FS_FS_COMPRESSION
                inode->i_mapping->a_ops = &f2fs_compress_aops;

/* generic_error_remove_page only truncates pages of regular inode */

Otherwise it looks good to me.

Thanks,

+               inode->i_mode |= S_IFREG;
  #endif
                mapping_set_gfp_mask(inode->i_mapping,
                        GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE);



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to