diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:52 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
commit | 277f2007ce187a6ff467579cb016824f80a2be10 (patch) | |
tree | 9e9a3b9921ce129649723140e17262c659f51ab0 /block/commit.c | |
parent | 5155853e90388d9c8c5370bcbe1b6484a92ee710 (diff) |
block: Mark bdrv_op_is_blocked() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_op_is_blocked() need to hold a reader lock for the graph
because it calls bdrv_get_device_or_node_name(), which accesses the
parents list of a node.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-18-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r-- | block/commit.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/commit.c b/block/commit.c index aa45beb0f0..43d1de7577 100644 --- a/block/commit.c +++ b/block/commit.c @@ -434,6 +434,7 @@ int bdrv_commit(BlockDriverState *bs) Error *local_err = NULL; GLOBAL_STATE_CODE(); + GRAPH_RDLOCK_GUARD_MAINLOOP(); if (!drv) return -ENOMEDIUM; |