Skip to content
  • Kevin Wolf's avatar
    7bb4941a
    block: Activate recursively even for already active nodes · 7bb4941a
    Kevin Wolf authored
    
    
    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.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    7bb4941a
    block: Activate recursively even for already active nodes
    Kevin Wolf authored
    
    
    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.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Loading