qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5313] fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank)
@ 2008-09-24 16:52 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2008-09-24 16:52 UTC (permalink / raw)
  To: qemu-devel

Revision: 5313
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5313
Author:   aliguori
Date:     2008-09-24 16:52:15 +0000 (Wed, 24 Sep 2008)

Log Message:
-----------
fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank)

During the debugging of the new revision of the zero dedup patch I
stepped on the following bug in block-qcow2.c:alloc_cluster_offset(). I
am not sure what the exact damage this bug can do, but it may be very
nasty because you way not notice it effects until you will do some
snapshot operations or similar actions that rely on the reference
counting.

The bug is easy to spot using the new "check" verb I added to the
qemu-img in one of the previous patches. I will resend the qemu-img
patch again with the new version of the zero dedup.

Signed-off-by: Shahar Frank <shaharf@qumranet.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/block-qcow2.c

Modified: trunk/block-qcow2.c
===================================================================
--- trunk/block-qcow2.c	2008-09-24 15:17:57 UTC (rev 5312)
+++ trunk/block-qcow2.c	2008-09-24 16:52:15 UTC (rev 5313)
@@ -917,7 +917,7 @@
             /* how many free clusters ? */
 
             while (i < nb_clusters) {
-                cluster_offset = l2_table[l2_index + i];
+                cluster_offset = be64_to_cpu(l2_table[l2_index + i]);
                 if (cluster_offset != 0)
                     break;
                 i++;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-24 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-24 16:52 [Qemu-devel] [5313] fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank) Anthony Liguori

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).