From 19a56037796a704191b1f14c33cebd7ca70c9056 Mon Sep 17 00:00:00 2001 From: Kevin Wolf <kwolf@redhat.com> Date: Fri, 18 Jun 2010 15:22:29 -0300 Subject: [PATCH 11/18] qcow2: Clear L2 table cache after write error RH-Author: Kevin Wolf <kwolf@redhat.com> Message-id: <1276874554-9820-12-git-send-email-kwolf@redhat.com> Patchwork-id: 9986 O-Subject: [RHEL-5.6 KVM PATCH 11/16] qcow2: Clear L2 table cache after write error Bugzilla: 605701 RH-Acked-by: Juan Quintela <quintela@redhat.com> RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com> RH-Acked-by: Christoph Hellwig <chellwig@redhat.com> RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Bugzilla: 605701 Upstream commit: 1b7c801b40ce90795397bb566d019c9b76ef9c13 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 <kwolf@redhat.com> --- qemu/block-qcow2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/block-qcow2.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c index 5274f12..ef0e26b 100644 --- a/qemu/block-qcow2.c +++ b/qemu/block-qcow2.c @@ -1113,6 +1113,7 @@ static int alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) ret = write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters); if (ret < 0) { + l2_cache_reset(bs); goto err; } -- 1.7.0.3