mirror of
https://git.proxmox.com/git/pve-qemu
synced 2025-08-24 09:05:01 +00:00

Commit f06b222
("fixes for QEMU 9.0") included a revert for the QEMU
commit 2ce6cff94d ("virtio-pci: fix use of a released vector"). That
commit caused some regressions which sounded just as bad as the fix.
Those regressions have now been addressed upstream, so pick up the fix
and drop the revert. Dropping the revert fixes the original issue that
commit 2ce6cff94d ("virtio-pci: fix use of a released vector")
addressed.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
39 lines
1.6 KiB
Diff
39 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Kevin Wolf <kwolf@redhat.com>
|
|
Date: Thu, 27 Jun 2024 20:12:44 +0200
|
|
Subject: [PATCH] block-copy: Fix missing graph lock
|
|
|
|
The graph lock needs to be held when calling bdrv_co_pdiscard(). Fix
|
|
block_copy_task_entry() to take it for the call.
|
|
|
|
WITH_GRAPH_RDLOCK_GUARD() was implemented in a weak way because of
|
|
limitations in clang's Thread Safety Analysis at the time, so that it
|
|
only asserts that the lock is held (which allows calling functions that
|
|
require the lock), but we never deal with the unlocking (so even after
|
|
the scope of the guard, the compiler assumes that the lock is still
|
|
held). This is why the compiler didn't catch this locking error.
|
|
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
(picked from https://lore.kernel.org/qemu-devel/20240627181245.281403-2-kwolf@redhat.com/)
|
|
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
|
|
---
|
|
block/block-copy.c | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/block/block-copy.c b/block/block-copy.c
|
|
index 7e3b378528..cc618e4561 100644
|
|
--- a/block/block-copy.c
|
|
+++ b/block/block-copy.c
|
|
@@ -595,7 +595,9 @@ static coroutine_fn int block_copy_task_entry(AioTask *task)
|
|
if (s->discard_source && ret == 0) {
|
|
int64_t nbytes =
|
|
MIN(t->req.offset + t->req.bytes, s->len) - t->req.offset;
|
|
- bdrv_co_pdiscard(s->source, t->req.offset, nbytes);
|
|
+ WITH_GRAPH_RDLOCK_GUARD() {
|
|
+ bdrv_co_pdiscard(s->source, t->req.offset, nbytes);
|
|
+ }
|
|
}
|
|
|
|
return ret;
|