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: Fri, 16 May 2014 10:54:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Markus Armbruster <address@hidden> writes:

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

I went over the whole series again looking for similar mistakes, and
found a few in PATCH 04 and 17.  Respin coming.



reply via email to

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