aboutsummaryrefslogtreecommitdiff
path: root/include/qemu
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2024-03-13 16:30:00 +0100
committerKevin Wolf <kwolf@redhat.com>2024-03-18 12:03:04 +0100
commitae5a40e8581185654a667fbbf7e4adbc2a2a3e45 (patch)
tree7f5df243c08ffc301ccb3a12b276e04617c6b624 /include/qemu
parentba49d760eb04630e7b15f423ebecf6c871b8f77b (diff)
downloadqemu-ae5a40e8581185654a667fbbf7e4adbc2a2a3e45.zip
qemu-ae5a40e8581185654a667fbbf7e4adbc2a2a3e45.tar.gz
qemu-ae5a40e8581185654a667fbbf7e4adbc2a2a3e45.tar.bz2
mirror: Don't call job_pause_point() under graph lock
Calling job_pause_point() while holding the graph reader lock potentially results in a deadlock: bdrv_graph_wrlock() first drains everything, including the mirror job, which pauses it. The job is only unpaused at the end of the drain section, which is when the graph writer lock has been successfully taken. However, if the job happens to be paused at a pause point where it still holds the reader lock, the writer lock can't be taken as long as the job is still paused. Mark job_pause_point() as GRAPH_UNLOCKED and fix mirror accordingly. Cc: qemu-stable@nongnu.org Buglink: https://issues.redhat.com/browse/RHEL-28125 Fixes: 004915a96a7a ("block: Protect bs->backing with graph_lock") Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20240313153000.33121-1-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/job.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 9ea98b5..2b873f2 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -483,7 +483,7 @@ void job_enter(Job *job);
*
* Called with job_mutex *not* held.
*/
-void coroutine_fn job_pause_point(Job *job);
+void coroutine_fn GRAPH_UNLOCKED job_pause_point(Job *job);
/**
* @job: The job that calls the function.