dfac4f3593
While the patch gives bdrv_graph_wrlock() as an example where the issue can manifest, something similar can happen even when that is disabled. Was able to reproduce the issue with while true; do qm resize 115 scsi0 +4M; sleep 1; done while running fio --name=make-mirror-work --size=100M --direct=1 --rw=randwrite \ --bs=4k --ioengine=psync --numjobs=5 --runtime=1200 --time_based in the VM. Fix picked up from: https://lists.nongnu.org/archive/html/qemu-devel/2023-12/msg01102.html Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Kevin Wolf <kwolf@redhat.com>
|
|
Date: Fri, 8 Dec 2023 13:43:52 +0100
|
|
Subject: [PATCH] block: Fix AioContext locking in qmp_block_resize()
|
|
|
|
The AioContext must be unlocked before calling blk_co_unref(), because
|
|
it takes the AioContext lock internally in blk_unref_bh(), which is
|
|
scheduled in the main thread. If we don't unlock, the AioContext is
|
|
locked twice and nested event loops such as in bdrv_graph_wrlock() will
|
|
deadlock.
|
|
|
|
Cc: qemu-stable@nongnu.org
|
|
Fixes: https://issues.redhat.com/browse/RHEL-15965
|
|
Fixes: 0c7d204f50c382c6baac8c94bd57af4a022b3888
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
(picked up from https://lists.nongnu.org/archive/html/qemu-devel/2023-12/msg01102.html)
|
|
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
|
|
---
|
|
blockdev.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/blockdev.c b/blockdev.c
|
|
index e6eba61484..c28462a633 100644
|
|
--- a/blockdev.c
|
|
+++ b/blockdev.c
|
|
@@ -2361,8 +2361,9 @@ void coroutine_fn qmp_block_resize(const char *device, const char *node_name,
|
|
|
|
bdrv_co_lock(bs);
|
|
bdrv_drained_end(bs);
|
|
- blk_co_unref(blk);
|
|
bdrv_co_unlock(bs);
|
|
+
|
|
+ blk_co_unref(blk);
|
|
}
|
|
|
|
void qmp_block_stream(const char *job_id, const char *device,
|