aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2023-02-03 16:21:46 +0100
committerKevin Wolf <kwolf@redhat.com>2023-02-23 19:49:12 +0100
commit880953493386a69416d2e1cdc063c670585a03ac (patch)
treece0deae2dc99760b4d124af36641d116efb5f561 /block/vmdk.c
parentc16b8bd4e5b423dac556cc37a81efeea4bba9cfe (diff)
block: Mark bdrv_co_flush() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_flush() need to hold a reader lock for the graph. For some places, we know that they will hold the lock, but we don't have the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock() with a FIXME comment. These places will be removed once everything is properly annotated. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230203152202.49054-8-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 3fcb75319f..d074f696aa 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1484,8 +1484,8 @@ exit:
return ret;
}
-static int coroutine_fn vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data,
- uint32_t offset)
+static int coroutine_fn GRAPH_RDLOCK
+vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data, uint32_t offset)
{
offset = cpu_to_le32(offset);
/* update L2 table */
@@ -2028,6 +2028,8 @@ static int coroutine_fn vmdk_pwritev(BlockDriverState *bs, uint64_t offset,
uint64_t bytes_done = 0;
VmdkMetaData m_data;
+ assume_graph_lock(); /* FIXME */
+
if (DIV_ROUND_UP(offset, BDRV_SECTOR_SIZE) > bs->total_sectors) {
error_report("Wrong offset: offset=0x%" PRIx64
" total_sectors=0x%" PRIx64,