If the node is an inode, its ino in the nat entry should be equal to the
ino in its node footer. Otherwise, we drop the file.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
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]",
+ nid, ni->ino, le32_to_cpu(node_blk->footer.ino));
+ return -EINVAL;
+ }
if (ntype != TYPE_INODE &&
node_blk->footer.nid == node_blk->footer.ino) {
ASSERT_MSG("nid[0x%x] footer.nid[0x%x] footer.ino[0x%x]",