[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/10] qcow2: Invalidate cache after failed read
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 06/10] qcow2: Invalidate cache after failed read |
Date: |
Thu, 4 Nov 2010 14:15:35 +0100 |
The cache content may be destroyed after a failed read, better not use it any
more.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/qcow2-cluster.c | 1 +
block/qcow2-refcount.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4f7dc59..b040208 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -188,6 +188,7 @@ static int l2_load(BlockDriverState *bs, uint64_t l2_offset,
ret = bdrv_pread(bs->file, l2_offset, *l2_table,
s->l2_size * sizeof(uint64_t));
if (ret < 0) {
+ qcow2_l2_cache_reset(bs);
return ret;
}
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;
}
--
1.7.2.3
- [Qemu-devel] [PULL 00/10] Block patches, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 01/10] scsi-disk: Implement rerror option, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 02/10] block: Allow bdrv_flush to return errors, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 03/10] scsi-disk: Complete failed requests in scsi_disk_emulate_command, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 05/10] vpc: Implement bdrv_flush, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 04/10] scsi-disk: Implement werror for flushes, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 06/10] qcow2: Invalidate cache after failed read,
Kevin Wolf <=
- [Qemu-devel] [PATCH 08/10] ide: Handle immediate bdrv_aio_flush failure, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 07/10] block: avoid a warning on 64 bit hosts with long as int64_t, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 10/10] scsi-disk: Fix immediate failure of bdrv_aio_*, Kevin Wolf, 2010/11/04
- [Qemu-devel] [PATCH 09/10] virtio-blk: Handle immediate flush failure properly, Kevin Wolf, 2010/11/04
- [Qemu-devel] Re: [PULL 00/10] Block patches, Anthony Liguori, 2010/11/04