Investigation shows, that f2fs_evict_inode, when called for 'meta_inode', uses invalidate_mapping_pages() for 'node_inode'.The analysis seems reasonable. Have you tried to swap the reclaim order of node_inde
But 'node_inode' is deleted before 'meta_inode' in f2fs_put_super via iput().
It seems that in common usage scenario this use-after-free is benign, because 'node_inode' remains partially valid data even after kmem_cache_free().
But things may change if, while 'meta_inode' is evicted in one f2fs filesystem, another (mounted) f2fs filesystem requests inode from cache, and formely
'node_inode' of the first filesystem is returned.
and meta_inode?
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 870fe19..e114418 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -430,8 +430,8 @@ static void f2fs_put_super(struct super_block *sb)
if (sbi->s_dirty && get_pages(sbi, F2FS_DIRTY_NODES))
write_checkpoint(sbi, true);
- iput(sbi->node_inode);
iput(sbi->meta_inode);
+ iput(sbi->node_inode);
/* destroy f2fs internal modules */
destroy_node_manager(sbi);
Thanks,
Gu