From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiXbD-0004Lq-QJ for qemu-devel@nongnu.org; Wed, 24 Sep 2008 12:52:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiXb8-0004Fe-80 for qemu-devel@nongnu.org; Wed, 24 Sep 2008 12:52:23 -0400 Received: from [199.232.76.173] (port=41873 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiXb7-0004FQ-Ks for qemu-devel@nongnu.org; Wed, 24 Sep 2008 12:52:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43085 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiXb7-0004x7-JG for qemu-devel@nongnu.org; Wed, 24 Sep 2008 12:52:17 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KiXb6-0005Gq-EL for qemu-devel@nongnu.org; Wed, 24 Sep 2008 16:52:16 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KiXb5-0005Gm-Vo for qemu-devel@nongnu.org; Wed, 24 Sep 2008 16:52:16 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 24 Sep 2008 16:52:15 +0000 Subject: [Qemu-devel] [5313] fix bug in block-qcow2.c:alloc_cluster_offset() (Shahar Frank) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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++;