qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] qcow2: Clear L2 table cache after write error
@ 2010-05-20 14:48 Kevin Wolf
  2010-05-20 14:48 ` [Qemu-devel] [PATCH 2/2] qcow2: Fix error handling in l2_allocate Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2010-05-20 14:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-21  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 14:48 [Qemu-devel] [PATCH 1/2] qcow2: Clear L2 table cache after write error Kevin Wolf
2010-05-20 14:48 ` [Qemu-devel] [PATCH 2/2] qcow2: Fix error handling in l2_allocate Kevin Wolf
2010-05-21  9:44   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).