OSDN Git Service

block: Mark bdrv_get_parent_name() and callers GRAPH_RDLOCK
authorKevin Wolf <kwolf@redhat.com>
Fri, 29 Sep 2023 14:51:47 +0000 (16:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 12 Oct 2023 14:31:33 +0000 (16:31 +0200)
commit4026f1c4f320aa072fa4cd299545cbc97315e246
tree04e245a6c7399739f81c44f25ac930c236dcdecb
parentc0fc5123ad33158f6f289a896b568b9adce7d1f2
block: Mark bdrv_get_parent_name() and callers GRAPH_RDLOCK

This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_get_parent_name() need to hold a reader lock for the graph
because it accesses the parents list of a node.

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: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-13-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
17 files changed:
block.c
block/backup.c
block/parallels.c
block/qcow.c
block/qcow2-bitmap.c
block/qcow2.c
block/qcow2.h
block/quorum.c
block/rbd.c
block/snapshot.c
block/vdi.c
block/vpc.c
block/vvfat.c
blockjob.c
include/block/block-io.h
include/block/block_int-io.h
include/block/qapi.h