All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] propagate write_refcount_block_entries error
Date: Tue, 01 Jun 2010 16:38:16 +0200	[thread overview]
Message-ID: <4C051B58.7050406@redhat.com> (raw)
In-Reply-To: <1275401486-10848-1-git-send-email-quintela@redhat.com>

Am 01.06.2010 16:11, schrieb Juan Quintela:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  block/qcow2-refcount.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index 744107c..4226dce 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -460,10 +460,10 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
>          table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT);
>          if ((old_table_index >= 0) && (table_index != old_table_index)) {
> 
> -            if (write_refcount_block_entries(bs, refcount_block_offset,
> -                first_index, last_index) < 0)
> -            {
> -                return -EIO;
> +            ret = write_refcount_block_entries(bs, refcount_block_offset,
> +                                               first_index, last_index);
> +            if (ret < 0) {
> +                return ret;
>              }
> 
>              first_index = -1;
> @@ -505,10 +505,10 @@ fail:
> 
>      /* Write last changed block to disk */
>      if (refcount_block_offset != 0) {
> -        if (write_refcount_block_entries(bs, refcount_block_offset,
> -            first_index, last_index) < 0)
> -        {
> -            return ret < 0 ? ret : -EIO;
> +        int write_ret = write_refcount_block_entries(bs, refcount_block_offset,
> +                                                     first_index, last_index);
> +        if (write_ret < 0){
> +            return ret < 0 ? ret : write_ret;
>          }
>      }
> 

Something similar (but more complete) is already queued:
http://repo.or.cz/w/qemu/kevin.git/commitdiff/b10200c1

Thanks anyway, the idea is the right one. :-)

Kevin

      reply	other threads:[~2010-06-01 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 14:11 [Qemu-devel] [PATCH] propagate write_refcount_block_entries error Juan Quintela
2010-06-01 14:38 ` Kevin Wolf [this message]

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=4C051B58.7050406@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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.