If a nid is valid, the ino in its nat entry should record its parent nid.
However if the ino is zero, we should drop the node.
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>
}
get_node_info(sbi, nid, ni);
+ if (ni->ino == 0) {
+ ASSERT_MSG("nid[0x%x] ino is 0", nid);
+ return -EINVAL;
+ }
+
if (ni->blk_addr == NEW_ADDR) {
ASSERT_MSG("nid is NEW_ADDR. [0x%x]", nid);
return -EINVAL;