From: John Snow <jsnow@redhat.com>
To: Pavel Butsykin <pbutsykin@virtuozzo.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] qcow2: fix return error code in qcow2_truncate()
Date: Wed, 20 Sep 2017 16:17:29 -0400 [thread overview]
Message-ID: <eaef3a7c-e634-50bb-a98c-9d5db7446c00@redhat.com> (raw)
In-Reply-To: <20170920135833.20472-2-pbutsykin@virtuozzo.com>
On 09/20/2017 09:58 AM, Pavel Butsykin wrote:
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> ---
> block/qcow2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 2174a84d1f..8a4311d338 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -3166,7 +3166,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,
> if (old_file_size < 0) {
> error_setg_errno(errp, -old_file_size,
> "Failed to inquire current file length");
> - return ret;
> + return old_file_size;
> }
>
> nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,
> @@ -3195,7 +3195,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,
> if (allocation_start < 0) {
> error_setg_errno(errp, -allocation_start,
> "Failed to resize refcount structures");
> - return -allocation_start;
> + return allocation_start;
> }
>
> clusters_allocated = qcow2_alloc_clusters_at(bs, allocation_start,
>
Yikes...
Reviewed-by: John Snow <jsnow@redhat.com>
next prev parent reply other threads:[~2017-09-20 20:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 13:58 [Qemu-devel] [PATCH 0/2] Truncate the tail of the image file in qcow2 shrinking Pavel Butsykin
2017-09-20 13:58 ` [Qemu-devel] [PATCH 1/2] qcow2: fix return error code in qcow2_truncate() Pavel Butsykin
2017-09-20 14:27 ` Eric Blake
2017-09-20 20:17 ` John Snow [this message]
2017-09-21 15:28 ` Max Reitz
2017-09-20 13:58 ` [Qemu-devel] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image Pavel Butsykin
2017-09-20 21:38 ` [Qemu-devel] [Qemu-block] " John Snow
2017-09-21 9:49 ` Pavel Butsykin
2017-09-21 16:48 ` John Snow
2017-09-21 18:23 ` Eric Blake
2017-09-21 15:28 ` [Qemu-devel] " Max Reitz
2017-09-21 16:16 ` Pavel Butsykin
2017-09-21 16:20 ` Max Reitz
2017-09-21 15:30 ` Max Reitz
2017-09-21 15:52 ` Pavel Butsykin
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=eaef3a7c-e634-50bb-a98c-9d5db7446c00@redhat.com \
--to=jsnow@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbutsykin@virtuozzo.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).