[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 07/12] qcow2: move qcow2_store_persistent_dirty_bit
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 07/12] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing |
Date: |
Tue, 19 Sep 2017 19:45:16 -0500 |
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>
(cherry picked from commit 83a8c775a8bf134eb18a719322939b74a818d750)
Signed-off-by: Michael Roth <address@hidden>
---
block/qcow2.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 40ba26c111..a756bf9541 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2053,6 +2053,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;
@@ -2067,14 +2075,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.11.0
- [Qemu-stable] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 09/12] mps2-an511: Fix wiring of UART overflow interrupt lines, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 10/12] scsi-bus: correct responses for INQUIRY and REQUEST SENSE, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 03/12] target/arm: Fix aa64 ldp register writeback, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 11/12] libvhost-user: support resuming vq->last_avail_idx based on used_idx, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 02/12] s390-ccw: Fix alignment for CCW1, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 12/12] vhost-user-bridge: fix resume regression (since 2.9), Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 07/12] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing,
Michael Roth <=
- [Qemu-stable] [PATCH 06/12] hw/arm/allwinner-a10: Mark the allwinner-a10 device with user_creatable = false, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 05/12] arm_gicv3_kvm: Fix compile warning, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 01/12] slirp: fix clearing ifq_so from pending packets, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 04/12] virtfs: error out gracefully when mandatory suboptions are missing, Michael Roth, 2017/09/19
- [Qemu-stable] [PATCH 08/12] vhost: Release memory references on cleanup, Michael Roth, 2017/09/19
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Thomas Huth, 2017/09/20
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Greg Kurz, 2017/09/20
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Michael Roth, 2017/09/25
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/12] Patch Round-up for stable 2.10.1, freeze on 2017-09-27, Anthony PERARD, 2017/09/26