linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] fsck.f2fs: fix to call ASSERT_MSG() in is_valid_ssa_{data, node}_blk()
Date: Sun, 25 Jun 2023 17:28:32 +0800	[thread overview]
Message-ID: <20230625092832.2936779-1-chao@kernel.org> (raw)

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

                 reply	other threads:[~2023-06-25  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230625092832.2936779-1-chao@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).