check_dir_item can handle missed/mismatched inode item well. Let it continue to check corresponding dir_item/index and inode_ref.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com> --- cmds-check.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index e33dd7db0048..eb65a18fe64b 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -5984,15 +5984,12 @@ begin: ret = btrfs_search_slot(NULL, root, &location, path, 0, 0); if (ret) { tmp_err |= INODE_ITEM_MISSING; - goto next; - } - - ii = btrfs_item_ptr(path->nodes[0], path->slots[0], - struct btrfs_inode_item); - mode = btrfs_inode_mode(path->nodes[0], ii); - if (imode_to_type(mode) != filetype) { - tmp_err |= INODE_ITEM_MISMATCH; - goto next; + } else { + ii = btrfs_item_ptr(path->nodes[0], path->slots[0], + struct btrfs_inode_item); + mode = btrfs_inode_mode(path->nodes[0], ii); + if (imode_to_type(mode) != filetype) + tmp_err |= INODE_ITEM_MISMATCH; } /* Check relative INODE_REF/INODE_EXTREF */ -- 2.16.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html