thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-backup-don-t-acquire-aio_context-in-backup_clean.patch

ddf19c
From 619b3aac9790a7ca7c01846144395a318a9ab250 Mon Sep 17 00:00:00 2001
ddf19c
From: Kevin Wolf <kwolf@redhat.com>
ddf19c
Date: Wed, 8 Apr 2020 17:29:14 +0100
ddf19c
Subject: [PATCH 3/6] backup: don't acquire aio_context in backup_clean
ddf19c
ddf19c
RH-Author: Kevin Wolf <kwolf@redhat.com>
ddf19c
Message-id: <20200408172917.18712-4-kwolf@redhat.com>
ddf19c
Patchwork-id: 94596
ddf19c
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 3/6] backup: don't acquire aio_context in backup_clean
ddf19c
Bugzilla: 1817621
ddf19c
RH-Acked-by: Eric Blake <eblake@redhat.com>
ddf19c
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
ddf19c
RH-Acked-by: Max Reitz <mreitz@redhat.com>
ddf19c
ddf19c
From: Stefan Reiter <s.reiter@proxmox.com>
ddf19c
ddf19c
All code-paths leading to backup_clean (via job_clean) have the job's
ddf19c
context already acquired. The job's context is guaranteed to be the same
ddf19c
as the one used by backup_top via backup_job_create.
ddf19c
ddf19c
Since the previous logic effectively acquired the lock twice, this
ddf19c
broke cleanup of backups for disks using IO threads, since the BDRV_POLL_WHILE
ddf19c
in bdrv_backup_top_drop -> bdrv_do_drained_begin would only release the lock
ddf19c
once, thus deadlocking with the IO thread.
ddf19c
ddf19c
This is a partial revert of 0abf2581717a19.
ddf19c
ddf19c
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
ddf19c
Reviewed-by: Max Reitz <mreitz@redhat.com>
ddf19c
Message-Id: <20200407115651.69472-4-s.reiter@proxmox.com>
ddf19c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ddf19c
(cherry picked from commit eca0f3524a4eb57d03a56b0cbcef5527a0981ce4)
ddf19c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 block/backup.c | 4 ----
ddf19c
 1 file changed, 4 deletions(-)
ddf19c
ddf19c
diff --git a/block/backup.c b/block/backup.c
ddf19c
index 1383e21..ec50946 100644
ddf19c
--- a/block/backup.c
ddf19c
+++ b/block/backup.c
ddf19c
@@ -135,11 +135,7 @@ static void backup_abort(Job *job)
ddf19c
 static void backup_clean(Job *job)
ddf19c
 {
ddf19c
     BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
ddf19c
-    AioContext *aio_context = bdrv_get_aio_context(s->backup_top);
ddf19c
-
ddf19c
-    aio_context_acquire(aio_context);
ddf19c
     bdrv_backup_top_drop(s->backup_top);
ddf19c
-    aio_context_release(aio_context);
ddf19c
 }
ddf19c
 
ddf19c
 void backup_do_checkpoint(BlockJob *job, Error **errp)
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c