aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSheng Yong <shengyong1@huawei.com>2016-02-22 17:01:15 +0000
committerluca020400 <luca.stefani.ge1@gmail.com>2016-04-04 17:17:56 +0200
commit3cf98bdf8492078a68fd64c67a1e1b193a35e084 (patch)
tree0a0dfd9d671d51d11f551e2c153f175a84d82d7d
parent95d62086f3b1f078e5bee6b53ab661939900bb3f (diff)
downloadandroid_external_f2fs-tools-3cf98bdf8492078a68fd64c67a1e1b193a35e084.tar.gz
android_external_f2fs-tools-3cf98bdf8492078a68fd64c67a1e1b193a35e084.tar.bz2
android_external_f2fs-tools-3cf98bdf8492078a68fd64c67a1e1b193a35e084.zip
fsck.f2fs: check nat_entry->ino for all nodes
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> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/fsck.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 0351228..a4922fb 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;
}