qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 14/18] block/sheepdog: Propagate errors through


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 14/18] block/sheepdog: Propagate errors through sd_prealloc()
Date: Thu, 15 May 2014 12:59:17 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/13/2014 10:02 AM, Markus Armbruster wrote:
> Cc: MORITA Kazutaka <address@hidden>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  block/sheepdog.c | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> @@ -1568,13 +1565,15 @@ static int sd_prealloc(const char *filename)
>           */
>          ret = bdrv_pread(bs, idx * SD_DATA_OBJ_SIZE, buf, SD_DATA_OBJ_SIZE);
>          if (ret < 0) {
> -            goto out;
> +            goto out_setg;
>          }
>          ret = bdrv_pwrite(bs, idx * SD_DATA_OBJ_SIZE, buf, SD_DATA_OBJ_SIZE);
>          if (ret < 0) {
> -            goto out;
> +            goto out_setg;
>          }
>      }
> +out_setg:
> +    error_setg_errno(errp, -ret, "Can't pre-allocate");

This unconditionally sets errp even when the for loop completes
normally.  Are you sure you want this control flow?  Maybe you are
missing a 'goto out' prior to the 'out_setg' label?


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]