linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, chao2.yu@samsung.com,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] fsck.f2fs: check nat_entry->ino for all nodes
Date: Mon, 22 Feb 2016 17:01:15 +0000	[thread overview]
Message-ID: <1456160475-544-1-git-send-email-shengyong1@huawei.com> (raw)

Commit 843f5b9388c4652a ("fsck.f2fs: check ino of an inode") checks
nat_entry->ino for inode. However, the checking is irrelevant to node
type, and if ino of other kinds of nodes gets corrupted, fsck.f2fs
cannot detect it. This patch fixes the commit.

Fixes: 843f5b9388c4652a ("fsck.f2fs: check ino of an inode")
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
This is against dev branch.
---
 fsck/fsck.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 6451595..2d07629 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -383,8 +383,8 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid,
 				le32_to_cpu(node_blk->footer.ino));
 		return -EINVAL;
 	}
-	if (ntype == TYPE_INODE && ni->ino != node_blk->footer.ino) {
-		ASSERT_MSG("nid[0x%x] TYPE_INODE nat_entry->ino[0x%x] footer.ino[0x%x]",
+	if (ni->ino != node_blk->footer.ino) {
+		ASSERT_MSG("nid[0x%x] nat_entry->ino[0x%x] footer.ino[0x%x]",
 				nid, ni->ino, le32_to_cpu(node_blk->footer.ino));
 		return -EINVAL;
 	}
-- 
2.7.1


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140

             reply	other threads:[~2016-02-22  9:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 17:01 Sheng Yong [this message]
2016-02-22 17:42 ` [PATCH] fsck.f2fs: check nat_entry->ino for all nodes Jaegeuk Kim

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=1456160475-544-1-git-send-email-shengyong1@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=chao2.yu@samsung.com \
    --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).