Skip to content

Commit

Permalink
f2fs: put directory inodes before checkpoint in roll-forward recovery
Browse files Browse the repository at this point in the history
Before checkpoint, we'd be better drop any inodes.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Jaegeuk Kim committed Sep 30, 2016
1 parent a468f0e commit 9e1e6df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/f2fs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,16 @@ 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,
};
err = write_checkpoint(sbi, &cpc);
}

destroy_fsync_dnodes(&dir_list);
kmem_cache_destroy(fsync_entry_slab);
return ret ? ret: err;
}

0 comments on commit 9e1e6df

Please sign in to comment.