[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/28] block: Take graph rdlock in bdrv_drop_intermediate()
From: |
Kevin Wolf |
Subject: |
[PULL 17/28] block: Take graph rdlock in bdrv_drop_intermediate() |
Date: |
Fri, 15 Sep 2023 16:43:33 +0200 |
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-ID: <20230911094620.45040-18-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block.c b/block.c
index 06d2a1b256..e024a6ccec 100644
--- a/block.c
+++ b/block.c
@@ -5938,9 +5938,11 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
backing_file_str = base->filename;
}
+ bdrv_graph_rdlock_main_loop();
QLIST_FOREACH(c, &top->parents, next_parent) {
updated_children = g_slist_prepend(updated_children, c);
}
+ bdrv_graph_rdunlock_main_loop();
/*
* It seems correct to pass detach_subchain=true here, but it triggers
--
2.41.0
- [PULL 02/28] preallocate: Factor out preallocate_truncate_to_real_size(), (continued)
- [PULL 02/28] preallocate: Factor out preallocate_truncate_to_real_size(), Kevin Wolf, 2023/09/15
- [PULL 01/28] block: Remove unused BlockReopenQueueEntry.perms_checked, Kevin Wolf, 2023/09/15
- [PULL 06/28] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions, Kevin Wolf, 2023/09/15
- [PULL 03/28] preallocate: Don't poll during permission updates, Kevin Wolf, 2023/09/15
- [PULL 10/28] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 04/28] block: Take AioContext lock for bdrv_append() more consistently, Kevin Wolf, 2023/09/15
- [PULL 05/28] block: Introduce bdrv_schedule_unref(), Kevin Wolf, 2023/09/15
- [PULL 12/28] block: Mark bdrv_attach_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 08/28] block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 18/28] block: Take graph rdlock in bdrv_change_aio_context(), Kevin Wolf, 2023/09/15
- [PULL 17/28] block: Take graph rdlock in bdrv_drop_intermediate(),
Kevin Wolf <=
- [PULL 16/28] block: Mark bdrv_parent_cb_change_media() GRAPH_RDLOCK, Kevin Wolf, 2023/09/15
- [PULL 22/28] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status(), Kevin Wolf, 2023/09/15
- [PULL 21/28] block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 23/28] qemu-img: map: report compressed data blocks, Kevin Wolf, 2023/09/15
- [PULL 19/28] block: Mark bdrv_root_unref_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 20/28] block: Mark bdrv_unref_child() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 09/28] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK, Kevin Wolf, 2023/09/15
- [PULL 07/28] block-coroutine-wrapper: Allow arbitrary parameter names, Kevin Wolf, 2023/09/15
- [PULL 11/28] block: Call transaction callbacks with lock held, Kevin Wolf, 2023/09/15
- [PULL 14/28] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK, Kevin Wolf, 2023/09/15