From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Cc: mrezanin@redhat.com, akong@redhat.com, famz@redhat.com,
stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: Fix overwriting 'ret' before using
Date: Wed, 13 Nov 2013 07:44:37 -0700 [thread overview]
Message-ID: <52839055.9060705@redhat.com> (raw)
In-Reply-To: <1384346626-27479-1-git-send-email-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
On 11/13/2013 05:43 AM, Kevin Wolf wrote:
> From: Fam Zheng <famz@redhat.com>
>
> 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 <famz@redhat.com>
> Signed-off-by: Amos Kong <akong@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>
> There was another case of overwritten ret that I added in v3.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-11-13 14:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 12:43 [Qemu-devel] [PATCH v3] qemu-img: Fix overwriting 'ret' before using Kevin Wolf
2013-11-13 14:44 ` Eric Blake [this message]
2013-11-14 1:32 ` Fam Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52839055.9060705@redhat.com \
--to=eblake@redhat.com \
--cc=akong@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mrezanin@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.