From 1c02e2a17104fe7fc11893125864dc0daf1e6d5b Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 28 Oct 2010 16:16:00 +0200 Subject: 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 Reviewed-by: Stefan Hajnoczi --- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+) (limited to 'block/qcow2-refcount.c') diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 0efb676..a10453c 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; } -- cgit v1.1