diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 9749758f9977ef17b4a2788fd8e26267d8dd0511..72603f1d8c2e8d03c0d0c30e42f68a400c358fdc 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1889,6 +1889,13 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) mutex_lock(&sbi->umount_mutex); release_ino_entry(sbi, true); f2fs_leave_shrinker(sbi); + /* + * Some dirty meta pages can be produced by recover_orphan_inodes() + * failed by EIO. Then, iput(node_inode) can trigger balance_fs_bg() + * followed by write_checkpoint() through f2fs_write_node_pages(), which + * falls into an infinite loop in sync_meta_pages(). + */ + truncate_inode_pages_final(META_MAPPING(sbi)); iput(sbi->node_inode); mutex_unlock(&sbi->umount_mutex); free_nm: