]> git.proxmox.com Git - mirror_qemu.git/commit
block: use co_wrapper_mixed_bdrv_rdlock in functions taking the rdlock
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Wed, 7 Dec 2022 13:18:37 +0000 (14:18 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 15 Dec 2022 15:08:23 +0000 (16:08 +0100)
commit90830f595062ecf0d2c96049f5e01f3d37a2107f
tree04aded0422d41fa449c2a6c807fa98985e8a974d
parente6d3f7a602a370362bc52b0aed7dfff1a0bf726d
block: use co_wrapper_mixed_bdrv_rdlock in functions taking the rdlock

Take the rdlock already, before we add the assertions.

All these functions either read the graph recursively, or call
BlockDriver callbacks that will eventually need to be protected by the
graph rdlock.

Do it now to all functions together, because many of these recursively
call each other.

For example, bdrv_co_truncate calls BlockDriver->bdrv_co_truncate, and
some driver callbacks implement their own .bdrv_co_truncate by calling
bdrv_flush inside. So if bdrv_flush asserts but bdrv_truncate does not
take the rdlock yet, the assertion will always fail.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20221207131838.239125-18-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/coroutines.h
include/block/block-io.h