[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/11] blockdev: drain while unlocked in internal_snapshot_ac
From: |
Kevin Wolf |
Subject: |
Re: [PATCH 06/11] blockdev: drain while unlocked in internal_snapshot_action() |
Date: |
Wed, 14 May 2025 19:26:09 +0200 |
Am 08.05.2025 um 16:09 hat Fiona Ebner geschrieben:
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>
> Could the bs associated to the device change because of polling
> when draining? If yes, does that mean we need to drain all in the
> beginning and not temporarily unlock?
I'm starting to hate this pattern. :-)
Maybe it would eventually be a good idea to have some helpers to deal
with this common problem of "I want to drain all nodes that will be
affected by the operation, but draining could change which nodes are
part of it".
For this specific case, though, I think drain all is right simply
because we may already rely on it: I suppose qmp_transaction() calls
bdrv_drain_all() for a reason, but it should actually be a drain
section. I'm pretty sure we're not just waiting for some requests to
complete, but want to keep other users away. Maybe the graph lock
actually covers whatever this drain was initially supposed to solve, but
bdrv_drain_all() doesn't look right.
So how about making it bdrv_drain_all_begin/end() in qmp_transaction()
just because that's the safe thing to do, and then we can just drop any
individual drains in action implementations?
Kevin
- [PATCH 02/11] block: move drain outside of read-locked bdrv_reopen_queue_child(), (continued)
- [PATCH 02/11] block: move drain outside of read-locked bdrv_reopen_queue_child(), Fiona Ebner, 2025/05/08
- [PATCH 01/11] block: remove outdated comments about AioContext locking, Fiona Ebner, 2025/05/08
- [PATCH 05/11] block: move drain outside of read-locked bdrv_inactivate_recurse(), Fiona Ebner, 2025/05/08
- [PATCH 11/11] iotests/graph-changes-while-io: add test case with removal of lower snapshot, Fiona Ebner, 2025/05/08
- [PATCH 06/11] blockdev: drain while unlocked in internal_snapshot_action(), Fiona Ebner, 2025/05/08
- Re: [PATCH 06/11] blockdev: drain while unlocked in internal_snapshot_action(),
Kevin Wolf <=
- [PATCH 08/11] block: mark bdrv_drained_begin() as GRAPH_UNLOCKED, Fiona Ebner, 2025/05/08
- [PATCH 09/11] block: move drain out of bdrv_change_aio_context(), Fiona Ebner, 2025/05/08
- [PATCH 03/11] block/snapshot: move drain outside of read-locked bdrv_snapshot_delete(), Fiona Ebner, 2025/05/08
- [PATCH 07/11] blockdev: drain while unlocked in external_snapshot_action(), Fiona Ebner, 2025/05/08
- [PATCH 10/11] block/graph-lock: add drain flag to bdrv_graph_wr{, un}lock, Fiona Ebner, 2025/05/08