Skip to contentSkip to conversation

f2fs: don't keep meta inode pages used for compressed block migration

PATCH New Chao Yu 1 participant 1 message Jul 7, 2020 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: don't keep meta inode pages used for compressed block migration

meta inode's pages are used for encrypted, verity and compressed blocks, so the meta inode's cache invalidation condition in do_checkpoint() should consider compression as well, not just for verity and encryption, fix it.

---
 fs/f2fs/checkpoint.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +3 -2
index 415bd120e561..c5593a6f9240 100644
@@ -1515,9 +1515,10 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 
 	/*
 	 * invalidate intermediate page cache borrowed from meta inode which are
-	 * used for migration of encrypted or verity inode's blocks.
+	 * used for migration of encrypted, verity or compressed inode's blocks.
 	 */
-	if (f2fs_sb_has_encrypt(sbi) || f2fs_sb_has_verity(sbi))
+	if (f2fs_sb_has_encrypt(sbi) || f2fs_sb_has_verity(sbi) ||
+		f2fs_sb_has_compression(sbi))
 		invalidate_mapping_pages(META_MAPPING(sbi),
 				MAIN_BLKADDR(sbi), MAX_BLKADDR(sbi) - 1);
 
Signature · 1 line
2.26.2