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: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 14/18] block/sheepdog: Propagate errors through sd_prealloc()
Date: Thu, 15 May 2014 21:45:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Eric Blake <address@hidden> writes:

> 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?

You're right, will fix, thanks!



reply via email to

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