Commit 94793c9e authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Stefan Bader

f2fs: put directory inodes before checkpoint in roll-forward recovery

BugLink: https://bugs.launchpad.net/bugs/1818797

commit 9e1e6df4 upstream.

Before checkpoint, we'd be better drop any inodes.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent fd2f997a
......@@ -597,6 +597,9 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
mutex_unlock(&sbi->cp_mutex);
/* let's drop all the directory inodes for clean checkpoint */
destroy_fsync_dnodes(&dir_list);
if (!err && need_writecp) {
struct cp_control cpc = {
.reason = CP_RECOVERY,
......@@ -604,7 +607,6 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
write_checkpoint(sbi, &cpc);
}
destroy_fsync_dnodes(&dir_list);
kmem_cache_destroy(fsync_entry_slab);
return ret ? ret: err;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment