aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/checkpoint.c6
-rw-r--r--fs/f2fs/f2fs.h1
-rw-r--r--fs/f2fs/recovery.c2
-rw-r--r--include/trace/events/f2fs.h1
4 files changed, 8 insertions, 2 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");
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 053361ace0ec..c06a25e5cec3 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -103,6 +103,7 @@ enum {
103 CP_UMOUNT, 103 CP_UMOUNT,
104 CP_FASTBOOT, 104 CP_FASTBOOT,
105 CP_SYNC, 105 CP_SYNC,
106 CP_RECOVERY,
106 CP_DISCARD, 107 CP_DISCARD,
107}; 108};
108 109
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 4b742c96c223..8d8ea99f2156 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -564,7 +564,7 @@ out:
564 mutex_unlock(&sbi->cp_mutex); 564 mutex_unlock(&sbi->cp_mutex);
565 } else if (need_writecp) { 565 } else if (need_writecp) {
566 struct cp_control cpc = { 566 struct cp_control cpc = {
567 .reason = CP_SYNC, 567 .reason = CP_RECOVERY,
568 }; 568 };
569 mutex_unlock(&sbi->cp_mutex); 569 mutex_unlock(&sbi->cp_mutex);
570 write_checkpoint(sbi, &cpc); 570 write_checkpoint(sbi, &cpc);
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 75724bd28356..8804f22a08d1 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -78,6 +78,7 @@
78 { CP_UMOUNT, "Umount" }, \ 78 { CP_UMOUNT, "Umount" }, \
79 { CP_FASTBOOT, "Fastboot" }, \ 79 { CP_FASTBOOT, "Fastboot" }, \
80 { CP_SYNC, "Sync" }, \ 80 { CP_SYNC, "Sync" }, \
81 { CP_RECOVERY, "Recovery" }, \
81 { CP_DISCARD, "Discard" }) 82 { CP_DISCARD, "Discard" })
82 83
83struct victim_sel_policy; 84struct victim_sel_policy;