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>
This commit is contained in:
Kevin Wolf 2010-10-28 16:16:00 +02:00
parent 4a4111851f
commit 1c02e2a171
2 changed files with 2 additions and 0 deletions

View file

@ -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;
}