]> git.proxmox.com Git - mirror_qemu.git/commit
blockdev: mirror: avoid potential deadlock when using iothread
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 19 Oct 2023 13:19:36 +0000 (15:19 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 31 Oct 2023 12:51:36 +0000 (13:51 +0100)
commit302823854b078f0525cf1babcc4fc9ff7b7d5f71
tree12ffe2f508a27a27404bd8ae1aa1d0c9c23d215a
parente462c6d27d0175a67cd373b3027ea5276d25dd4e
blockdev: mirror: avoid potential deadlock when using iothread

The bdrv_getlength() function is a generated co-wrapper and uses
AIO_WAIT_WHILE() to wait for the spawned coroutine. AIO_WAIT_WHILE()
expects the lock to be acquired exactly once.

Fix a case where it may be acquired twice. This can happen when the
source node is explicitly specified as the @replaces parameter or if the
source node is a filter node.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Message-ID: <20231019131936.414246-4-f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c