[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/24] block: Mark bdrv_skip_filters() and callers GRAPH_RDLO
From: |
Eric Blake |
Subject: |
Re: [PATCH 08/24] block: Mark bdrv_skip_filters() and callers GRAPH_RDLOCK |
Date: |
Fri, 27 Oct 2023 15:52:15 -0500 |
User-agent: |
NeoMutt/20231023 |
On Fri, Oct 27, 2023 at 05:53:17PM +0200, Kevin Wolf wrote:
> This adds GRAPH_RDLOCK annotations to declare that callers of
> bdrv_skip_filters() need to hold a reader lock for the graph because it
> calls bdrv_filter_child(), which accesses bs->file/backing.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/block/block-global-state.h | 8 ++++---
> include/block/block_int-io.h | 4 ++--
> block/block-backend.c | 1 +
> block/block-copy.c | 9 +++++++-
> block/commit.c | 5 ++++-
> block/mirror.c | 34 +++++++++++++++++++++---------
> block/stream.c | 22 ++++++++++++-------
> blockdev.c | 7 +++---
> qemu-img.c | 18 +++++++++++++---
> 9 files changed, 77 insertions(+), 31 deletions(-)
>
> diff --git a/include/block/block-global-state.h
> b/include/block/block-global-state.h
> index 3ae468ea15..b6860ae43b 100644
> --- a/include/block/block-global-state.h
> +++ b/include/block/block-global-state.h
> @@ -144,9 +144,11 @@ int bdrv_change_backing_file(BlockDriverState *bs, const
> char *backing_file,
> void bdrv_register(BlockDriver *bdrv);
> int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base,
> const char *backing_file_str);
> -BlockDriverState *bdrv_find_overlay(BlockDriverState *active,
> - BlockDriverState *bs);
> -BlockDriverState *bdrv_find_base(BlockDriverState *bs);
> +
> +BlockDriverState * GRAPH_RDLOCK
> +bdrv_find_overlay(BlockDriverState *active, BlockDriverState *bs);
> +
> +BlockDriverState * GRAPH_RDLOCK bdrv_find_base(BlockDriverState *bs);
Similar story to 3/24 earlier in the series - these are callers of
bdrv_skip_filters(), which in turn have callers that are already
locked, or which are touched to lock in this patch. May be worth
tweaking the commit message to mention them by name.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
- [PATCH 00/24] block: Graph locking part 6 (bs->file/backing), Kevin Wolf, 2023/10/27
- [PATCH 01/24] block: Mark bdrv_probe_blocksizes() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 02/24] block: Mark bdrv_has_zero_init() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 08/24] block: Mark bdrv_skip_filters() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- Re: [PATCH 08/24] block: Mark bdrv_skip_filters() and callers GRAPH_RDLOCK,
Eric Blake <=
- [PATCH 13/24] block: Mark bdrv_set_backing_hd_drained() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27
- [PATCH 11/24] block: Mark bdrv_filter_child() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 03/24] block: Mark bdrv_filter_bs() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/10/27
- [PATCH 05/24] block: Mark block_job_add_bdrv() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27
- [PATCH 15/24] block: Mark bdrv_replace_node_common() GRAPH_WRLOCK, Kevin Wolf, 2023/10/27