[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK
From: |
Emanuele Giuseppe Esposito |
Subject: |
Re: [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK |
Date: |
Mon, 21 Aug 2023 09:35:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 |
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> Instead of taking the writer lock internally, require callers to already
> hold it when calling bdrv_replace_child_tran(). 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.
>
> While a graph lock is held, polling is not allowed. Therefore draining
> the necessary nodes can no longer be done in bdrv_remove_child() and
> bdrv_replace_node_noperm(), but the callers must already make sure that
> they are drained.
>
> 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_attach_child_noperm(), which currently
> requires to be called unlocked. Once it changes, the transaction
> callbacks can be changed, too.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
- [PATCH 00/21] Graph locking part 4 (node management), Kevin Wolf, 2023/08/17
- [PATCH 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked, Kevin Wolf, 2023/08/17
- [PATCH 06/21] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions, Kevin Wolf, 2023/08/17
- [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK, Kevin Wolf, 2023/08/17
- [PATCH 11/21] block: Call transaction callbacks with lock held, Kevin Wolf, 2023/08/17
- [PATCH 03/21] preallocate: Don't poll during permission updates, Kevin Wolf, 2023/08/17
- [PATCH 02/21] preallocate: Factor out preallocate_truncate_to_real_size(), Kevin Wolf, 2023/08/17