Received: from [140.186.70.92] (port=58978 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OI2hh-0007PH-Mc for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OI2hg-0008C4-KU for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63622) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OI2hg-0008Br-Cu for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:36 -0400 From: Kevin Wolf Date: Fri, 28 May 2010 18:46:00 +0200 Message-Id: <1275065173-24045-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1275065173-24045-1-git-send-email-kwolf@redhat.com> References: <1275065173-24045-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 01/14] qcow2: Clear L2 table cache after write error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org If the L2 table was already updated in cache, but writing it to disk has failed, we must not continue using the changed version in the cache to stay consistent with what's on the disk. Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index c11680d..ed5c4b2 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -696,6 +696,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) ret = write_l2_entries(bs, l2_table, l2_offset, l2_index, m->nb_clusters); if (ret < 0) { + qcow2_l2_cache_reset(bs); goto err; } -- 1.6.6.1