summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Wolf2010-04-13 11:43:27 +0200
committerKevin Wolf2010-05-28 13:14:25 +0200
commit1b7c801b40ce90795397bb566d019c9b76ef9c13 (patch)
tree4efd1aaa1638c5be722281ee3d56a12df76bd56b
parentvhost_net.c: v2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1... (diff)
downloadqemu-1b7c801b40ce90795397bb566d019c9b76ef9c13.tar.gz
qemu-1b7c801b40ce90795397bb566d019c9b76ef9c13.tar.xz
qemu-1b7c801b40ce90795397bb566d019c9b76ef9c13.zip
qcow2: Clear L2 table cache after write error
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>
-rw-r--r--block/qcow2-cluster.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index c11680d12a..ed5c4b2a67 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;
}