OSDN Git Service

block: avoid potential deadlock during bdrv_graph_wrlock() in bdrv_close()
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 19 Oct 2023 13:19:35 +0000 (15:19 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 31 Oct 2023 12:51:36 +0000 (13:51 +0100)
commite462c6d27d0175a67cd373b3027ea5276d25dd4e
tree8dc492c6b5eb4c5ed7ba4f87160f00849d41ab7c
parent67446e605dc2cc3e14a4d212bc97e6a2038e8f6a
block: avoid potential deadlock during bdrv_graph_wrlock() in bdrv_close()

by passing the BlockDriverState along, so the held AioContext can be
dropped before polling. See commit 31b2ddfea3 ("graph-lock: Unlock the
AioContext while polling") which introduced this functionality for
more information.

The only way to reach bdrv_close() is via bdrv_unref() and for calling
that the BlockDriverState's AioContext lock is supposed to be held.

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