[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] block: Activate recursively even for already active node
From: |
Max Reitz |
Subject: |
Re: [PATCH 1/3] block: Activate recursively even for already active nodes |
Date: |
Thu, 19 Dec 2019 13:46:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 17.12.19 15:59, Kevin Wolf wrote:
> bdrv_invalidate_cache_all() assumes that all nodes in a given subtree
> are either active or inactive when it starts. Therefore, as soon as it
> arrives at an already active node, it stops.
>
> However, this assumption is wrong. For example, it's possible to take a
> snapshot of an inactive node, which results in an active overlay over an
> inactive backing file. The active overlay is probably also the root node
> of an inactive BlockBackend (blk->disable_perm == true).
>
> In this case, bdrv_invalidate_cache_all() does not need to do anything
> to activate the overlay node, but it still needs to recurse into the
> children and the parents to make sure that after returning success,
> really everything is activated.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block.c | 50 ++++++++++++++++++++++++--------------------------
> 1 file changed, 24 insertions(+), 26 deletions(-)
Basically the only change is to not skip the whole function when the
node is already active but only the part that actually activates the
node. blk_root_activate() is a no-op for already-active BBs, so this
looks good to me.
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature