On Mon, Oct 19, 2015 at 07:37:54PM +0800, Eryu Guan wrote:
> Error number -EIO is assigned to ret but later ret is overwritten by
> wait_for_worker().
> 
> Signed-off-by: Eryu Guan <[email protected]>
> ---
>  btrfs-image.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/btrfs-image.c b/btrfs-image.c
> index 82eed05..7d3a2f8 100644
> --- a/btrfs-image.c
> +++ b/btrfs-image.c
> @@ -2465,6 +2465,7 @@ static int restore_metadump(const char *input, FILE 
> *out, int old_restore,
>       u64 bytenr = 0;
>       FILE *in = NULL;
>       int ret = 0;
> +     int err = 0;
>  
>       if (!strcmp(input, "-")) {
>               in = stdin;
> @@ -2526,7 +2527,7 @@ static int restore_metadump(const char *input, FILE 
> *out, int old_restore,
>               if (le64_to_cpu(header->magic) != HEADER_MAGIC ||
>                   le64_to_cpu(header->bytenr) != bytenr) {
>                       fprintf(stderr, "bad header in metadump image\n");
> -                     ret = -EIO;
> +                     err = -EIO;

Shouldn't we do 'goto out' instead? As this looks likes the metadump is
broken anyway so there's no point in continuing.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to