Skip to content

Commit 9e1e6df

Browse files
author
Jaegeuk Kim
committed
f2fs: put directory inodes before checkpoint in roll-forward recovery
Before checkpoint, we'd be better drop any inodes. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent a468f0e commit 9e1e6df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/f2fs/recovery.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,14 +630,16 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
630630
set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
631631
mutex_unlock(&sbi->cp_mutex);
632632

633+
/* let's drop all the directory inodes for clean checkpoint */
634+
destroy_fsync_dnodes(&dir_list);
635+
633636
if (!err && need_writecp) {
634637
struct cp_control cpc = {
635638
.reason = CP_RECOVERY,
636639
};
637640
err = write_checkpoint(sbi, &cpc);
638641
}
639642

640-
destroy_fsync_dnodes(&dir_list);
641643
kmem_cache_destroy(fsync_entry_slab);
642644
return ret ? ret: err;
643645
}

0 commit comments

Comments
 (0)