@@ -2407,6 +2407,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi)
ret = f2fs_fsync_device();
ASSERT(ret >= 0);
+
+ MSG(0, "Info: fix_checkpoint() cur_cp:%d\n", sbi->cur_cp);
}
static void fix_checkpoints(struct f2fs_sb_info *sbi)
@@ -3284,7 +3286,8 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (sbi->total_valid_block_count == fsck->chk.valid_blk_cnt) {
printf(" [Ok..] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt);
} else {
- printf(" [Fail] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt);
+ printf(" [Fail] [0x%x, 0x%x]\n", sbi->total_valid_block_count,
+ (u32)fsck->chk.valid_blk_cnt);
verify_failed = true;
}
@@ -3292,7 +3295,8 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (sbi->total_valid_node_count == fsck->chk.valid_node_cnt) {
printf(" [Ok..] [0x%x]\n", fsck->chk.valid_node_cnt);
} else {
- printf(" [Fail] [0x%x]\n", fsck->chk.valid_node_cnt);
+ printf(" [Fail] [0x%x, 0x%x]\n", sbi->total_valid_node_count,
+ fsck->chk.valid_node_cnt);
verify_failed = true;
}
@@ -3300,7 +3304,8 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (sbi->total_valid_node_count == fsck->chk.valid_nat_entry_cnt) {
printf(" [Ok..] [0x%x]\n", fsck->chk.valid_nat_entry_cnt);
} else {
- printf(" [Fail] [0x%x]\n", fsck->chk.valid_nat_entry_cnt);
+ printf(" [Fail] [0x%x, 0x%x]\n", sbi->total_valid_node_count,
+ fsck->chk.valid_nat_entry_cnt);
verify_failed = true;
}
@@ -3308,7 +3313,8 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (sbi->total_valid_inode_count == fsck->chk.valid_inode_cnt) {
printf(" [Ok..] [0x%x]\n", fsck->chk.valid_inode_cnt);
} else {
- printf(" [Fail] [0x%x]\n", fsck->chk.valid_inode_cnt);
+ printf(" [Fail] [0x%x, 0x%x]\n", sbi->total_valid_inode_count,
+ fsck->chk.valid_inode_cnt);
verify_failed = true;
}
@@ -3317,7 +3323,9 @@ int fsck_verify(struct f2fs_sb_info *sbi)
fsck->chk.sit_free_segs) {
printf(" [Ok..] [0x%x]\n", fsck->chk.sit_free_segs);
} else {
- printf(" [Fail] [0x%x]\n", fsck->chk.sit_free_segs);
+ printf(" [Fail] [0x%x, 0x%x]\n",
+ le32_to_cpu(F2FS_CKPT(sbi)->free_segment_count),
+ fsck->chk.sit_free_segs);
verify_failed = true;
}
@@ -2782,8 +2782,11 @@ void flush_journal_entries(struct f2fs_sb_info *sbi)
int n_nats = flush_nat_journal_entries(sbi);
int n_sits = flush_sit_journal_entries(sbi);
- if (n_nats || n_sits)
+ if (n_nats || n_sits) {
+ MSG(0, "Info: flush_journal_entries() n_nats: %d, n_sits: %d\n",
+ n_nats, n_sits);
write_checkpoints(sbi);
+ }
}
void flush_sit_entries(struct f2fs_sb_info *sbi)
@@ -3259,6 +3262,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi)
ret = f2fs_fsync_device();
ASSERT(ret >= 0);
+
+ MSG(0, "Info: write_checkpoint() cur_cp:%d\n", sbi->cur_cp);
}
void write_checkpoints(struct f2fs_sb_info *sbi)
In order to track details of stat info and repair flow. [FSCK] valid_block_count matching with CP [Fail] [0x2, 0x0] [FSCK] valid_node_count matching with CP (de lookup) [Fail] [0x1, 0x0] [FSCK] valid_node_count matching with CP (nat lookup) [Fail] [0x1, 0x0] [FSCK] valid_inode_count matched with CP [Fail] [0x1, 0x0] Info: flush_journal_entries() n_nats: 1, n_sits: 6 Info: write_checkpoint() cur_cp:1 Info: fix_checkpoint() cur_cp:1 Signed-off-by: Chao Yu <chao@kernel.org> --- fsck/fsck.c | 18 +++++++++++++----- fsck/mount.c | 7 ++++++- 2 files changed, 19 insertions(+), 6 deletions(-)