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] dump.f2fs: remove redundant check condition in dump_node()
Date: Wed, 19 Jul 2023 15:01:22 +0800	[thread overview]
Message-ID: <20230719070122.2361853-1-chao@kernel.org> (raw)

In dump_node(), f2fs_is_valid_blkaddr() has checked ni.blk_addr's
validity and dump_node() will bail up if ni.blk_addr is invalid,
so let's remove redundant check condition and print below:

	if (ni.blk_addr == 0x0)
		MSG(force, "Invalid nat entry\n\n");

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fsck/dump.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fsck/dump.c b/fsck/dump.c
index 6c1857f..e7a1c5c 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -605,9 +605,7 @@ int dump_node(struct f2fs_sb_info *sbi, nid_t nid, int force)
 
 	dev_read_block(node_blk, ni.blk_addr);
 
-	if (ni.blk_addr == 0x0)
-		MSG(force, "Invalid nat entry\n\n");
-	else if (!is_sit_bitmap_set(sbi, ni.blk_addr))
+	if (!is_sit_bitmap_set(sbi, ni.blk_addr))
 		MSG(force, "Invalid sit bitmap, %u\n\n", ni.blk_addr);
 
 	DBG(1, "node_blk.footer.ino [0x%x]\n", le32_to_cpu(node_blk->footer.ino));
-- 
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-07-19  7:01 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=20230719070122.2361853-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).