linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v3 1/2] f2fs: fix remove page failed in invalidate compress pages
@ 2021-11-29  2:13 Fengnan Chang
  2021-11-29  2:13 ` [f2fs-dev] [PATCH v3 2/2] f2fs: support POSIX_FADV_DONTNEED drop compressed page cache Fengnan Chang
  0 siblings, 1 reply; 3+ messages in thread
From: Fengnan Chang @ 2021-11-29  2:13 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: Fengnan Chang, linux-f2fs-devel

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 <changfengnan@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/inode.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 0f8b2df3e1e0..1db7823d5a13 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -516,6 +516,11 @@ 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
+		 */
+		inode->i_mode |= S_IFREG;
 #endif
 		mapping_set_gfp_mask(inode->i_mapping,
 			GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE);
-- 
2.32.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-29  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-29  2:13 [f2fs-dev] [PATCH v3 1/2] f2fs: fix remove page failed in invalidate compress pages Fengnan Chang
2021-11-29  2:13 ` [f2fs-dev] [PATCH v3 2/2] f2fs: support POSIX_FADV_DONTNEED drop compressed page cache Fengnan Chang
2021-11-29  2:23   ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).