aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2023-06-25 17:28:32 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-06-30 15:07:47 -0700
commit213cc16d09e8e575697f47da18d5dafcb20e852f (patch)
treeea444d52f9f078981ad4a894731b5ba591f57167
parent057d65c98e7a7171264dd857983caaf6f530a078 (diff)
downloadf2fs-tools-213cc16d09e8e575697f47da18d5dafcb20e852f.tar.gz
fsck.f2fs: fix to call ASSERT_MSG() in is_valid_ssa_{data,node}_blk()
Previously, fsck fixes summary entry and writeback last summary block into SSA area, however, it missed to flush summary cache in CP area, result in repair failure. This patch fixes to call ASSERT_MSG() for such case, in order to trigger additional checkpoint during fsck_verify(), so that last fixed summary entry can be persisted correctly. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c
index a4db2a3..051510f 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -171,7 +171,7 @@ static int is_valid_ssa_node_blk(struct f2fs_sb_info *sbi, u32 nid,
need_fix = 1;
se = get_seg_entry(sbi, segno);
if(IS_NODESEG(se->type)) {
- FIX_MSG("Summary footer indicates a node segment: 0x%x", segno);
+ ASSERT_MSG("Summary footer indicates a node segment: 0x%x", segno);
sum_blk->footer.entry_type = SUM_TYPE_NODE;
} else {
ret = -EINVAL;
@@ -197,7 +197,7 @@ static int is_valid_ssa_node_blk(struct f2fs_sb_info *sbi, u32 nid,
ASSERT_MSG("Invalid node seg summary\n");
ret = -EINVAL;
} else {
- FIX_MSG("Set node summary 0x%x -> [0x%x] [0x%x]",
+ ASSERT_MSG("Set node summary 0x%x -> [0x%x] [0x%x]",
segno, nid, blk_addr);
sum_entry->nid = cpu_to_le32(nid);
need_fix = 1;
@@ -296,7 +296,7 @@ static int is_valid_ssa_data_blk(struct f2fs_sb_info *sbi, u32 blk_addr,
need_fix = 1;
se = get_seg_entry(sbi, segno);
if (IS_DATASEG(se->type)) {
- FIX_MSG("Summary footer indicates a data segment: 0x%x", segno);
+ ASSERT_MSG("Summary footer indicates a data segment: 0x%x", segno);
sum_blk->footer.entry_type = SUM_TYPE_DATA;
} else {
ret = -EINVAL;
@@ -329,7 +329,7 @@ static int is_valid_ssa_data_blk(struct f2fs_sb_info *sbi, u32 blk_addr,
/* delete wrong index */
ret = -EINVAL;
} else {
- FIX_MSG("Set data summary 0x%x -> [0x%x] [0x%x] [0x%x]",
+ ASSERT_MSG("Set data summary 0x%x -> [0x%x] [0x%x] [0x%x]",
segno, parent_nid, version, idx_in_node);
sum_entry->nid = cpu_to_le32(parent_nid);
sum_entry->version = version;