aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-04-09 20:03:53 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-16 12:45:40 -0400
commit10027551ccf5459cc771c31ac8bc8e5cc8db45f8 (patch)
treeeae6cfe1d0daae9d6ed5e30d63e2f966af847d46 /fs/f2fs/checkpoint.c
parentfeb7cbb079e63ebb7c0bd7022d2ba9c1dd15c69b (diff)
f2fs: pass checkpoint reason on roll-forward recovery
This patch adds CP_RECOVERY to remain recovery information for checkpoint. And, it makes sure writing checkpoint in this case. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 384bfc4c36c3..a5e17a2a0781 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1051,7 +1051,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1051 mutex_lock(&sbi->cp_mutex); 1051 mutex_lock(&sbi->cp_mutex);
1052 1052
1053 if (!is_sbi_flag_set(sbi, SBI_IS_DIRTY) && 1053 if (!is_sbi_flag_set(sbi, SBI_IS_DIRTY) &&
1054 cpc->reason != CP_DISCARD && cpc->reason != CP_UMOUNT) 1054 (cpc->reason == CP_FASTBOOT || cpc->reason == CP_SYNC))
1055 goto out; 1055 goto out;
1056 if (unlikely(f2fs_cp_error(sbi))) 1056 if (unlikely(f2fs_cp_error(sbi)))
1057 goto out; 1057 goto out;
@@ -1086,6 +1086,10 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1086 1086
1087 unblock_operations(sbi); 1087 unblock_operations(sbi);
1088 stat_inc_cp_count(sbi->stat_info); 1088 stat_inc_cp_count(sbi->stat_info);
1089
1090 if (cpc->reason == CP_RECOVERY)
1091 f2fs_msg(sbi->sb, KERN_NOTICE,
1092 "checkpoint: version = %llx", ckpt_ver);
1089out: 1093out:
1090 mutex_unlock(&sbi->cp_mutex); 1094 mutex_unlock(&sbi->cp_mutex);
1091 trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint"); 1095 trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");