[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 12/20] mirror: Require GRAPH_RDLOCK for accessing a node's
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 12/20] mirror: Require GRAPH_RDLOCK for accessing a node's parent list |
Date: |
Thu, 4 May 2023 08:17:17 -0500 |
User-agent: |
NeoMutt/20230407 |
On Thu, May 04, 2023 at 01:57:42PM +0200, Kevin Wolf wrote:
> 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/mirror.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/block/mirror.c b/block/mirror.c
> index 80fa345071..b5c4ae31f3 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -1416,7 +1416,7 @@ static MirrorOp *coroutine_fn
> active_write_prepare(MirrorBlockJob *s,
> return op;
> }
>
> -static void coroutine_fn active_write_settle(MirrorOp *op)
> +static void coroutine_fn GRAPH_RDLOCK active_write_settle(MirrorOp *op)
> {
> uint64_t start_chunk = op->offset / op->s->granularity;
> uint64_t end_chunk = DIV_ROUND_UP(op->offset + op->bytes,
> --
> 2.40.1
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH v2 04/20] block: Don't call no_coroutine_fns in qmp_block_resize(), (continued)
- [PATCH v2 05/20] test-bdrv-drain: Don't modify the graph in coroutines, Kevin Wolf, 2023/05/04
- [PATCH v2 06/20] graph-lock: Add GRAPH_UNLOCKED(_PTR), Kevin Wolf, 2023/05/04
- [PATCH v2 09/20] nbd: Remove nbd_co_flush() wrapper function, Kevin Wolf, 2023/05/04
- [PATCH v2 14/20] block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 11/20] vhdx: Require GRAPH_RDLOCK for accessing a node's parent list, Kevin Wolf, 2023/05/04
- [PATCH v2 16/20] block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 15/20] block: Mark bdrv_co_debug_event() GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 07/20] graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lock, Kevin Wolf, 2023/05/04
- [PATCH v2 12/20] mirror: Require GRAPH_RDLOCK for accessing a node's parent list, Kevin Wolf, 2023/05/04
- Re: [PATCH v2 12/20] mirror: Require GRAPH_RDLOCK for accessing a node's parent list,
Eric Blake <=
- [PATCH v2 13/20] block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 20/20] block: Mark bdrv_refresh_limits() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 08/20] block: .bdrv_open is non-coroutine and unlocked, Kevin Wolf, 2023/05/04
- [PATCH v2 10/20] nbd: Mark nbd_co_do_establish_connection() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 17/20] block: Mark bdrv_query_bds_stats() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 18/20] block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- [PATCH v2 19/20] block: Mark bdrv_recurse_can_replace() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/05/04
- Re: [PATCH v2 00/20] Graph locking, part 3 (more block drivers), Kevin Wolf, 2023/05/09
- Re: [PATCH v2 00/20] Graph locking, part 3 (more block drivers), Stefan Hajnoczi, 2023/05/09