block: Call .bdrv_co_create(_opts) unlocked
These are functions that modify the graph, so they must be able to take a writer lock. This is impossible if they already hold the reader lock. If they need a reader lock for some of their operations, they should take it internally. Many of them go through blk_*(), which will always take the lock itself. Direct calls of bdrv_*() need to take the reader lock. Note that while locking for bdrv_co_*() calls is checked by TSA, this is not the case for the mixed_coroutine_fns bdrv_*(). Holding the lock is still required when they are called from coroutine context like here! This effectively reverts 4ec8df01, but adds some internal locking instead. Signed-off-by:Kevin Wolf <kwolf@redhat.com> Message-Id: <20230510203601.418015-2-kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
Showing
- block.c 0 additions, 1 deletionblock.c
- block/create.c 0 additions, 1 deletionblock/create.c
- block/crypto.c 12 additions, 13 deletionsblock/crypto.c
- block/parallels.c 3 additions, 3 deletionsblock/parallels.c
- block/qcow.c 3 additions, 3 deletionsblock/qcow.c
- block/qcow2.c 24 additions, 13 deletionsblock/qcow2.c
- block/qed.c 3 additions, 3 deletionsblock/qed.c
- block/raw-format.c 1 addition, 1 deletionblock/raw-format.c
- block/vdi.c 6 additions, 5 deletionsblock/vdi.c
- block/vhdx.c 5 additions, 3 deletionsblock/vhdx.c
- block/vmdk.c 12 additions, 15 deletionsblock/vmdk.c
- block/vpc.c 3 additions, 3 deletionsblock/vpc.c
- include/block/block-global-state.h 4 additions, 4 deletionsinclude/block/block-global-state.h
- include/block/block_int-common.h 2 additions, 2 deletionsinclude/block/block_int-common.h
Loading
Please register or sign in to comment