[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing



commit c6841b112e995a0635db59fe25da9a308c595b7a
Author:     Pavel Butsykin <pbutsykin@xxxxxxxxxxxxx>
AuthorDate: Mon Sep 4 13:18:00 2017 +0300
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Thu Sep 14 19:29:40 2017 -0500

    qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing
    
    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: qemu-stable@xxxxxxxxxx
    Signed-off-by: Pavel Butsykin <pbutsykin@xxxxxxxxxxxxx>
    Signed-off-by: Kevin Wolf <kwolf@xxxxxxxxxx>
    (cherry picked from commit 83a8c775a8bf134eb18a719322939b74a818d750)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 block/qcow2.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 40ba26c..a756bf9 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);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.