From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjwtM-000251-Db for qemu-devel@nongnu.org; Tue, 23 Feb 2010 10:41:44 -0500 Received: from [199.232.76.173] (port=39455 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjwtL-00024r-Vj for qemu-devel@nongnu.org; Tue, 23 Feb 2010 10:41:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjwtK-0000p3-RU for qemu-devel@nongnu.org; Tue, 23 Feb 2010 10:41:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8946) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjwtJ-0000or-RA for qemu-devel@nongnu.org; Tue, 23 Feb 2010 10:41:42 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1NFfemK000586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 23 Feb 2010 10:41:40 -0500 From: Kevin Wolf Date: Tue, 23 Feb 2010 16:40:51 +0100 Message-Id: <1266939654-26510-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/3] qcow2: Rewrite alloc_refcount_block List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, quintela@redhat.com The current implementation of alloc_refcount_block and grow_refcount_table has fundamental problems regarding error handling. There are some places where an I/O error means that the image is going to be corrupted. I have found that the only way to fix this is to completely rewrite the thing. v2: Addresses Juan's review comments: - Simplified next_refcount_table_size - Fixed alloc_refcount_block Kevin Wolf (3): qcow2: Factor next_refcount_table_size out qcow2: Rewrite alloc_refcount_block/grow_refcount_table qcow2: More checks for qemu-img check block/qcow2-refcount.c | 346 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 250 insertions(+), 96 deletions(-)