qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] qemu-img: Fix overwriting 'ret' before using


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: Fix overwriting 'ret' before using
Date: Wed, 13 Nov 2013 07:44:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 11/13/2013 05:43 AM, Kevin Wolf wrote:
> From: Fam Zheng <address@hidden>
> 
> This patch moves ret assignment after reporting original error.
> 
> We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when
> I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a "wrong"
> mismatch offset. This fixes two bugs.
> 
> In the first if branch, setting ret to 1 before using it makes dead code
> in the next line: pnum is never added to mismatch offset even if ret was
> 0.
> 
> In the other if branch, currently the output error is always -4:
>   strerror(-4) -> Unknown error -4
> 
> Added regression test in case 048.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> Signed-off-by: Amos Kong <address@hidden>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> 
> There was another case of overwritten ret that I added in v3.

Reviewed-by: Eric Blake <address@hidden>

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