diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:56 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
commit | 680e0cc40c5830ebcbfa0bce99bf932e1a4cf6c6 (patch) | |
tree | 25d4599f69d96706708243a273e1a4f37124075e /include/block | |
parent | b59b466071391cb76b39584e1558be2d0797c054 (diff) |
block: Protect bs->children with graph_lock
Almost all functions that access the child links already take the graph
lock now. Add locking to the remaining users and finally annotate the
struct field itself as protected by the graph lock.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-22-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block_int-common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 0e37acd976..b8d9d24f39 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -1042,7 +1042,7 @@ struct BdrvChild { */ bool quiesced_parent; - QLIST_ENTRY(BdrvChild) next; + QLIST_ENTRY(BdrvChild GRAPH_RDLOCK_PTR) next; QLIST_ENTRY(BdrvChild GRAPH_RDLOCK_PTR) next_parent; }; @@ -1176,7 +1176,7 @@ struct BlockDriverState { * See also comment in include/block/block.h, to learn how backing and file * are connected with BdrvChildRole. */ - QLIST_HEAD(, BdrvChild) children; + QLIST_HEAD(, BdrvChild GRAPH_RDLOCK_PTR) children; BdrvChild *backing; BdrvChild *file; |