block: Mark bdrv_root_attach_child() GRAPH_WRLOCK
authorKevin Wolf <kwolf@redhat.com>
Fri, 27 Oct 2023 15:53:13 +0000 (17:53 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 7 Nov 2023 18:14:19 +0000 (19:14 +0100)
commit03b9eaca540322dd6dd4810aa57f3196ce971542
tree44cca4b8180fe5271b3b710c46412cb447ab0f91
parentf5a3a270fe2b89d1be39f50ebdd15db80d59014b
block: Mark bdrv_root_attach_child() GRAPH_WRLOCK

Instead of taking the writer lock internally, require callers to already
hold it when calling bdrv_root_attach_child(). 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.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231027155333.420094-5-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/block-backend.c
blockjob.c
include/block/block_int-global-state.h