pve-qemu-qoup/debian/patches/pve/0034-vma_writer_close-avoid-call-to-aio_poll-acquire-flus.patch
Thomas Lamprecht cbb547903c run backup related code inside co-routines and improve locking
Patches-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-23 09:14:51 +02:00

36 lines
982 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dietmar Maurer <dietmar@proxmox.com>
Date: Tue, 22 Oct 2019 12:48:19 +0200
Subject: [PATCH] vma_writer_close: avoid call to aio_poll (acquire flush_lock
instead)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
vma-writer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/vma-writer.c b/vma-writer.c
index b163fa2d3a..fe86b18a60 100644
--- a/vma-writer.c
+++ b/vma-writer.c
@@ -705,9 +705,7 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
int i;
- while (vmaw->co_writer) {
- aio_poll(qemu_get_aio_context(), true);
- }
+ qemu_co_mutex_lock(&vmaw->flush_lock); // wait for pending writes
assert(vmaw->co_writer == NULL);
@@ -748,6 +746,8 @@ int vma_writer_close(VmaWriter *vmaw, Error **errp)
error_setg(errp, "%s", vmaw->errmsg);
}
+ qemu_co_mutex_unlock(&vmaw->flush_lock);
+
return vmaw->status;
}