qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix (at least one cause of) qcow2 corruption.
Date: Sun, 05 Apr 2009 13:18:03 -0500	[thread overview]
Message-ID: <49D8F5DB.5090501@us.ibm.com> (raw)
In-Reply-To: <1238539254.15350.554.camel@voxel>

Nolan wrote:
> qcow2's get_cluster_offset() scans forward in the l2 table to find other
> clusters that have the same allocation status as the first cluster.
> This is used by (among others) qcow_is_allocated().
>
> Unfortunately, it was not checking to be sure that it didn't fall off
> the end of the l2 table.  This patch adds that check.
>
> The symptom that motivated me to look into this was that
> bdrv_is_allocated() was returning false when there was in fact data
> there.  This is one of many ways this bug could lead to data corruption.
>
> I checked the other place that scans for consecutive unallocated blocks
> (alloc_cluster_offset()) and it appears to be OK:
>     nb_clusters = MIN(nb_clusters, s->l2_size - l2_index);
> appears to prevent the same problem from occurring.
>
> Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
>   
Applied to stable.  Thanks

-- 
Regards,

Anthony Liguori

  parent reply	other threads:[~2009-04-05 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 22:40 [Qemu-devel] [PATCH] Fix (at least one cause of) qcow2 corruption Nolan
2009-04-05 17:42 ` Anthony Liguori
2009-04-05 18:18 ` Anthony Liguori [this message]
2009-04-09 20:44 ` Christoph Hellwig

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=49D8F5DB.5090501@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --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).