On 2018年01月26日 16:35, Su Yue wrote:
> 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.fnst@xxxxxxxxxxxxxx>
Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
Thanks,
Qu
> ---
> 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 */
>
Attachment:
signature.asc
Description: OpenPGP digital signature
