aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-refcount.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-10-28 16:16:00 +0200
committerKevin Wolf <kwolf@redhat.com>2010-11-04 13:54:37 +0100
commit1c02e2a17104fe7fc11893125864dc0daf1e6d5b (patch)
tree856838c21e8b45c9305b642d7b6e9339bc634600 /block/qcow2-refcount.c
parent4a4111851fa75bc91028a26eb75dcdd136d9032d (diff)
qcow2: Invalidate cache after failed read
The cache content may be destroyed after a failed read, better not use it any more. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r--block/qcow2-refcount.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 0efb6760cb..a10453c875 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -103,6 +103,7 @@ static int load_refcount_block(BlockDriverState *bs,
ret = bdrv_pread(bs->file, refcount_block_offset, s->refcount_block_cache,
s->cluster_size);
if (ret < 0) {
+ s->refcount_block_cache_offset = 0;
return ret;
}