[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 14/14] qcow2: move qcow2_store_persistent_dirty_bitma
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 14/14] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing |
Date: |
Wed, 6 Sep 2017 16:02:46 +0200 |
From: Pavel Butsykin <address@hidden>
After calling qcow2_inactivate(), all qcow2 caches must be flushed, but this
may not happen, because the last call qcow2_store_persistent_dirty_bitmaps()
can lead to marking l2/refcont cache as dirty.
Let's move qcow2_store_persistent_dirty_bitmaps() before the caсhe flushing
to fix it.
Cc: address@hidden
Signed-off-by: Pavel Butsykin <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 2ec399663e..bae5893327 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2036,6 +2036,14 @@ static int qcow2_inactivate(BlockDriverState *bs)
int ret, result = 0;
Error *local_err = NULL;
+ qcow2_store_persistent_dirty_bitmaps(bs, &local_err);
+ if (local_err != NULL) {
+ result = -EINVAL;
+ error_report_err(local_err);
+ error_report("Persistent bitmaps are lost for node '%s'",
+ bdrv_get_device_or_node_name(bs));
+ }
+
ret = qcow2_cache_flush(bs, s->l2_table_cache);
if (ret) {
result = ret;
@@ -2050,14 +2058,6 @@ static int qcow2_inactivate(BlockDriverState *bs)
strerror(-ret));
}
- qcow2_store_persistent_dirty_bitmaps(bs, &local_err);
- if (local_err != NULL) {
- result = -EINVAL;
- error_report_err(local_err);
- error_report("Persistent bitmaps are lost for node '%s'",
- bdrv_get_device_or_node_name(bs));
- }
-
if (result == 0) {
qcow2_mark_clean(bs);
}
--
2.13.5
- [Qemu-block] [PULL 01/14] block: pass bdrv_* methods to bs->file by default in block filters, (continued)
- [Qemu-block] [PULL 01/14] block: pass bdrv_* methods to bs->file by default in block filters, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 04/14] block: add default implementations for bdrv_co_get_block_status(), Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 06/14] qcow: Check failure of bdrv_getlength() and bdrv_truncate(), Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 10/14] block: tidy ThrottleGroupMember initializations, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 07/14] block: document semantics of bdrv_co_preadv|pwritev, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 12/14] block: add throttle block filter driver, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 09/14] block: add aio_context field in ThrottleGroupMember, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 08/14] block: move ThrottleGroup membership to ThrottleGroupMember, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 11/14] block: convert ThrottleGroup to object with QOM, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 13/14] qemu-iotests: add 184 for throttle filter driver, Kevin Wolf, 2017/09/06
- [Qemu-block] [PULL 14/14] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing,
Kevin Wolf <=
- Re: [Qemu-block] [Qemu-devel] [PULL 00/14] Block layer patches, Peter Maydell, 2017/09/07