[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/27] block: avoid potential deadlock during bdrv_graph_wrlock()
From: |
Kevin Wolf |
Subject: |
[PULL 12/27] block: avoid potential deadlock during bdrv_graph_wrlock() in bdrv_close() |
Date: |
Tue, 31 Oct 2023 19:59:03 +0100 |
From: Fiona Ebner <f.ebner@proxmox.com>
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block.c b/block.c
index f9cf05ddcf..a527aa1a4c 100644
--- a/block.c
+++ b/block.c
@@ -5200,7 +5200,7 @@ static void bdrv_close(BlockDriverState *bs)
bs->drv = NULL;
}
- bdrv_graph_wrlock(NULL);
+ bdrv_graph_wrlock(bs);
QLIST_FOREACH_SAFE(child, &bs->children, next, next) {
bdrv_unref_child(bs, child);
}
--
2.41.0
- [PULL 15/27] util/defer-call: move defer_call() to util/, (continued)
- [PULL 15/27] util/defer-call: move defer_call() to util/, Kevin Wolf, 2023/10/31
- [PULL 21/27] block/mirror: determine copy_to_target only once, Kevin Wolf, 2023/10/31
- [PULL 19/27] block/mirror: set actively_synced even after the job is ready, Kevin Wolf, 2023/10/31
- [PULL 20/27] block/mirror: move dirty bitmap to filter, Kevin Wolf, 2023/10/31
- [PULL 17/27] virtio-blk: remove batch notification BH, Kevin Wolf, 2023/10/31
- [PULL 13/27] blockdev: mirror: avoid potential deadlock when using iothread, Kevin Wolf, 2023/10/31
- [PULL 18/27] blockjob: introduce block-job-change QMP command, Kevin Wolf, 2023/10/31
- [PULL 09/27] block: Fix locking in media change monitor commands, Kevin Wolf, 2023/10/31
- [PULL 11/27] blockjob: drop AioContext lock before calling bdrv_graph_wrlock(), Kevin Wolf, 2023/10/31
- [PULL 25/27] blockjob: query driver-specific info via a new 'query' driver method, Kevin Wolf, 2023/10/31
- [PULL 12/27] block: avoid potential deadlock during bdrv_graph_wrlock() in bdrv_close(),
Kevin Wolf <=
- [PULL 14/27] block: rename blk_io_plug_call() API to defer_call(), Kevin Wolf, 2023/10/31
- [PULL 10/27] iotests: Test media change with iothreads, Kevin Wolf, 2023/10/31
- [PULL 23/27] qapi/block-core: use JobType for BlockJobInfo's type, Kevin Wolf, 2023/10/31
- [PULL 22/27] mirror: implement mirror_change method, Kevin Wolf, 2023/10/31
- [PULL 26/27] mirror: return mirror-specific information upon query, Kevin Wolf, 2023/10/31
- [PULL 27/27] iotests: add test for changing mirror's copy_mode, Kevin Wolf, 2023/10/31
- [PULL 24/27] qapi/block-core: turn BlockJobInfo into a union, Kevin Wolf, 2023/10/31
- [PULL 08/27] iotests: add tests for "qemu-img rebase" with compression, Kevin Wolf, 2023/10/31
- Re: [PULL 00/27] Block layer patches, Stefan Hajnoczi, 2023/10/31