yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ddf19c
From bc78ee07bf400cbff0021367e05d308870471710 Mon Sep 17 00:00:00 2001
ddf19c
From: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
Date: Fri, 7 Feb 2020 11:27:45 +0000
ddf19c
Subject: [PATCH 12/18] backup-top: Begin drain earlier
ddf19c
ddf19c
RH-Author: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
Message-id: <20200207112749.25073-6-slp@redhat.com>
ddf19c
Patchwork-id: 93757
ddf19c
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 5/9] backup-top: Begin drain earlier
ddf19c
Bugzilla: 1745606 1746217 1773517 1779036 1782111 1782175 1783965
ddf19c
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
ddf19c
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
ddf19c
RH-Acked-by: Max Reitz <mreitz@redhat.com>
ddf19c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
ddf19c
From: Max Reitz <mreitz@redhat.com>
ddf19c
ddf19c
When dropping backup-top, we need to drain the node before freeing the
ddf19c
BlockCopyState.  Otherwise, requests may still be in flight and then the
ddf19c
assertion in shres_destroy() will fail.
ddf19c
ddf19c
(This becomes visible in intermittent failure of 056.)
ddf19c
ddf19c
Cc: qemu-stable@nongnu.org
ddf19c
Signed-off-by: Max Reitz <mreitz@redhat.com>
ddf19c
Message-id: 20191219182638.104621-1-mreitz@redhat.com
ddf19c
Signed-off-by: Max Reitz <mreitz@redhat.com>
ddf19c
(cherry picked from commit 503ca1262bab2c11c533a4816d1ff4297d4f58a6)
ddf19c
Signed-off-by: Sergio Lopez <slp@redhat.com>
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 block/backup-top.c | 4 ++--
ddf19c
 1 file changed, 2 insertions(+), 2 deletions(-)
ddf19c
ddf19c
diff --git a/block/backup-top.c b/block/backup-top.c
ddf19c
index 7cdb1f8..818d3f2 100644
ddf19c
--- a/block/backup-top.c
ddf19c
+++ b/block/backup-top.c
ddf19c
@@ -257,12 +257,12 @@ void bdrv_backup_top_drop(BlockDriverState *bs)
ddf19c
     BDRVBackupTopState *s = bs->opaque;
ddf19c
     AioContext *aio_context = bdrv_get_aio_context(bs);
ddf19c
 
ddf19c
-    block_copy_state_free(s->bcs);
ddf19c
-
ddf19c
     aio_context_acquire(aio_context);
ddf19c
 
ddf19c
     bdrv_drained_begin(bs);
ddf19c
 
ddf19c
+    block_copy_state_free(s->bcs);
ddf19c
+
ddf19c
     s->active = false;
ddf19c
     bdrv_child_refresh_perms(bs, bs->backing, &error_abort);
ddf19c
     bdrv_replace_node(bs, backing_bs(bs), &error_abort);
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c