* [f2fs-dev] [PATCH] fsck.f2fs: fix to call ASSERT_MSG() in is_valid_ssa_{data, node}_blk()
@ 2023-06-25 9:28 Chao Yu
0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2023-06-25 9:28 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-f2fs-devel
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>
---
fsck/fsck.c | 8 ++++----
1 file 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;
--
2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-25 9:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-25 9:28 [f2fs-dev] [PATCH] fsck.f2fs: fix to call ASSERT_MSG() in is_valid_ssa_{data, node}_blk() Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).