[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK |
Date: |
Tue, 22 Aug 2023 15:16:36 -0400 |
On Thu, Aug 17, 2023 at 02:50:09PM +0200, Kevin Wolf wrote:
> Instead of taking the writer lock internally, require callers to already
> hold it when calling bdrv_attach_child_common(). These callers will
> typically already hold the graph lock once the locking work is
> completed, which means that they can't call functions that take it
> internally.
>
> Note that the transaction callbacks still take the lock internally, so
> tran_finalize() must be called without the lock held. This is because
> bdrv_append() also calls bdrv_replace_node_noperm(), which currently
> requires the transaction callbacks to be called unlocked. In the next
> step, both of them can be switched to locked tran_finalize() calls
> together.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block.c | 133 +++++++++++++++++++++++++++++++------------------
> block/stream.c | 20 ++++++--
> 2 files changed, 100 insertions(+), 53 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature
- Re: [PATCH 04/21] block: Take AioContext lock for bdrv_append() more consistently, (continued)
- [PATCH 17/21] block: Take graph rdlock in bdrv_drop_intermediate(), Kevin Wolf, 2023/08/17
- [PATCH 14/21] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/08/17
- [PATCH 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK, Kevin Wolf, 2023/08/17
- Re: [PATCH 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK,
Stefan Hajnoczi <=
- [PATCH 18/21] block: Take graph rdlock in bdrv_change_aio_context(), Kevin Wolf, 2023/08/17
- [PATCH 21/21] block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK, Kevin Wolf, 2023/08/17
- [PATCH 20/21] block: Mark bdrv_unref_child() GRAPH_WRLOCK, Kevin Wolf, 2023/08/17
- [PATCH 12/21] block: Mark bdrv_attach_child() GRAPH_WRLOCK, Kevin Wolf, 2023/08/17