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 <kw...@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
- [PATCH 20/21] block: Mark bdrv_unref_child() GR... Kevin Wolf
- Re: [PATCH 20/21] block: Mark bdrv_unref_c... Emanuele Giuseppe Esposito
- Re: [PATCH 20/21] block: Mark bdrv_unref_c... Stefan Hajnoczi
- [PATCH 12/21] block: Mark bdrv_attach_child() G... Kevin Wolf
- Re: [PATCH 12/21] block: Mark bdrv_attach_... Emanuele Giuseppe Esposito
- Re: [PATCH 12/21] block: Mark bdrv_attach_... Stefan Hajnoczi
- [PATCH 13/21] block: Mark bdrv_parent_perms_con... Kevin Wolf
- Re: [PATCH 13/21] block: Mark bdrv_parent_... Emanuele Giuseppe Esposito
- Re: [PATCH 13/21] block: Mark bdrv_parent_... Stefan Hajnoczi
- [PATCH 09/21] block: Mark bdrv_replace_child_tr... Kevin Wolf
- Re: [PATCH 09/21] block: Mark bdrv_replace... Emanuele Giuseppe Esposito
- Re: [PATCH 09/21] block: Mark bdrv_replace... Stefan Hajnoczi
- [PATCH 14/21] block: Mark bdrv_get_cumulative_p... Kevin Wolf
- Re: [PATCH 14/21] block: Mark bdrv_get_cum... Emanuele Giuseppe Esposito
- Re: [PATCH 14/21] block: Mark bdrv_get_cum... Stefan Hajnoczi
- [PATCH 21/21] block: Mark bdrv_add/del_child() ... Kevin Wolf
- Re: [PATCH 21/21] block: Mark bdrv_add/del... Emanuele Giuseppe Esposito
- Re: [PATCH 21/21] block: Mark bdrv_add/del... Stefan Hajnoczi
- [PATCH 18/21] block: Take graph rdlock in bdrv_... Kevin Wolf
- Re: [PATCH 18/21] block: Take graph rdlock... Emanuele Giuseppe Esposito
- [PATCH 17/21] block: Take graph rdlock in bdrv_... Kevin Wolf