qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Filip Navara <filip.navara@gmail.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@lvivier.info>, Kevin Wolf <kwolf@suse.de>,
	kvm-devel <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] qcow2 corruption observed, fixed by reverting old change
Date: Fri, 6 Mar 2009 23:37:02 +0100	[thread overview]
Message-ID: <5b31733c0903061437i1b90568aj312af652fb226341@mail.gmail.com> (raw)
In-Reply-To: <20090211164814.GA7161@shareable.org>

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

On Wed, Feb 11, 2009 at 5:48 PM, Jamie Lokier <jamie@shareable.org> wrote:
> Kevin Wolf wrote:
>> Besides reviewing the code over and over again, I think the only real
>> chance is that you can get a non-productive copy of your image and add
>> some debug code so that we can see at least which code path is causing
>> problems.
>
> I have a copy of my image to reproduce the bug, so I can test patches
> including diagnostic patches.  That's what I did to narrow it down.

Let's see. I have looked at the change in revision 5006 back and forth
and this is the only bug that I can see...

Does the patch help any?

Best regards,
Filip Navara

[-- Attachment #2: block-qcow2.diff --]
[-- Type: application/octet-stream, Size: 623 bytes --]

Index: block-qcow2.c
===================================================================
--- block-qcow2.c	(revision 6729)
+++ block-qcow2.c	(working copy)
@@ -621,7 +621,7 @@
     if (!offset)
         return 0;
 
-    for (i = start; i < start + nb_clusters; i++)
+    for (i = start; i < start + nb_clusters && i < s->l2_size; i++)
         if (offset + i * cluster_size != (be64_to_cpu(l2_table[i]) & ~mask))
             break;
 
@@ -632,7 +632,7 @@
 {
     int i = 0;
 
-    while(nb_clusters-- && l2_table[i] == 0)
+    while(nb_clusters-- && i < s->l2_size && l2_table[i] == 0)
         i++;
 
     return i;

  parent reply	other threads:[~2009-03-06 22:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11  7:00 [Qemu-devel] qcow2 corruption observed, fixed by reverting old change Jamie Lokier
2009-02-11  9:57 ` Kevin Wolf
2009-02-11 11:27   ` Jamie Lokier
2009-02-11 11:41   ` Jamie Lokier
2009-02-11 12:41     ` Kevin Wolf
2009-02-11 16:48       ` Jamie Lokier
2009-02-12 22:57         ` Consul
2009-02-12 23:19           ` [Qemu-devel] " Consul
2009-02-13  7:50             ` Marc Bevand
2009-02-16 12:44         ` [Qemu-devel] " Kevin Wolf
2009-02-17  0:43           ` Jamie Lokier
2009-03-06 22:37         ` Filip Navara [this message]
2009-02-12  5:45       ` Chris Wright
2009-02-12 11:08         ` Johannes Schindelin
     [not found] ` <loom.20090213T060937-534@post.gmane.org>
2009-02-13 11:16   ` [Qemu-devel] " Kevin Wolf
2009-02-13 16:23     ` Jamie Lokier
2009-02-13 18:43       ` Chris Wright
2009-02-14  6:31       ` Marc Bevand
2009-02-14 22:28         ` Dor Laor
2009-02-15  2:27           ` Jamie Lokier
2009-02-15  7:56           ` Marc Bevand
2009-02-15  2:37         ` Jamie Lokier
2009-02-15 10:57     ` Gleb Natapov
2009-02-15 11:46       ` Marc Bevand
2009-02-15 11:54         ` Marc Bevand

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=5b31733c0903061437i1b90568aj312af652fb226341@mail.gmail.com \
    --to=filip.navara@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@suse.de \
    --cc=laurent@lvivier.info \
    --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).