On 2018年01月26日 16:35, Su Yue wrote:
> If repair_dir_item deleted the item, goto last checked then returns
> instead of searching di_key again then returns -ENOENT.
>
> Signed-off-by: Su Yue <suy.fnst@xxxxxxxxxxxxxx>
> ---
> cmds-check.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cmds-check.c b/cmds-check.c
> index eb65a18fe64b..4ce6139b3ab1 100644
> --- a/cmds-check.c
> +++ b/cmds-check.c
> @@ -5931,7 +5931,7 @@ begin:
> path->slots[0]--;
Well, not a problem of this patch, but I found previous lines have problem:
------
ret = btrfs_search_slot(NULL, root, di_key, path, 0, 0);
/* the item was deleted, let path point the last checked item */
if (ret > 0) {
if (path->slots[0] == 0)
btrfs_prev_leaf(root, path);
else
path->slots[0]--;
}
------
Here return value of btrfs_prev_leaf() is ignored, which can return
error or >1.
Thanks,
Qu
> }
> if (ret)
> - goto out;
> + return err;> }
>
> node = path->nodes[0];
> @@ -6040,7 +6040,7 @@ next:
> break;
> }
> }
> -out:
> +
> /* research path */
> btrfs_release_path(path);
> ret = btrfs_search_slot(NULL, root, di_key, path, 0, 0);
>
Attachment:
signature.asc
Description: OpenPGP digital signature
