[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/20] vhdx: Take graph lock for accessing a node's parent list
From: |
Kevin Wolf |
Subject: |
[PATCH 11/20] vhdx: Take graph lock for accessing a node's parent list |
Date: |
Tue, 25 Apr 2023 19:31:49 +0200 |
This adds GRAPH_RDLOCK annotations to declare that functions accessing
the parent list of a node need to hold a reader lock for the graph. As
it happens, they already do.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/vhdx.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/vhdx.c b/block/vhdx.c
index 00777da91a..b20b1edf11 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1506,8 +1506,9 @@ exit:
* There are 2 headers, and the highest sequence number will represent
* the active header
*/
-static int vhdx_create_new_headers(BlockBackend *blk, uint64_t image_size,
- uint32_t log_size)
+static int coroutine_fn GRAPH_RDLOCK
+vhdx_create_new_headers(BlockBackend *blk, uint64_t image_size,
+ uint32_t log_size)
{
BlockDriverState *bs = blk_bs(blk);
BdrvChild *child;
@@ -1897,8 +1898,8 @@ exit:
* .---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
* 1MB
*/
-static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts,
- Error **errp)
+static int coroutine_fn GRAPH_RDLOCK
+vhdx_co_create(BlockdevCreateOptions *opts, Error **errp)
{
BlockdevCreateOptionsVhdx *vhdx_opts;
BlockBackend *blk = NULL;
--
2.40.0
- [PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR), (continued)
- [PATCH 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR), Kevin Wolf, 2023/04/25
- [PATCH 10/20] nbd: Mark nbd_co_do_establish_connection() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 05/20] test-bdrv-drain: Don't modify the graph in coroutines, Kevin Wolf, 2023/04/25
- [PATCH 07/20] graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lock, Kevin Wolf, 2023/04/25
- [PATCH 15/20] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 11/20] vhdx: Take graph lock for accessing a node's parent list,
Kevin Wolf <=
- [PATCH 13/20] block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 14/20] block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/04/25
- [PATCH 08/20] block: .bdrv_open is non-coroutine and unlocked, Kevin Wolf, 2023/04/25
- [PATCH 09/20] nbd: Remove nbd_co_flush() wrapper function, Kevin Wolf, 2023/04/25
- [PATCH 12/20] mirror: Take graph lock for accessing a node's parent list, Kevin Wolf, 2023/04/25