Skip to content
  • Kevin Wolf's avatar
    067acf28
    block: Fix blockdev-snapshot error handling · 067acf28
    Kevin Wolf authored
    
    
    For blockdev-snapshot, external_snapshot_prepare() accepts an arbitrary
    node reference at first and only checks later whether it already has a
    backing file. Between those places, other errors can occur.
    
    Therefore checking in external_snapshot_abort() whether state->new_bs
    has a backing file is not sufficient to tell whether bdrv_append() was
    already completed or not. Trying to undo the bdrv_append() when it
    wasn't even executed is wrong.
    
    Introduce a new boolean flag in the state to fix this.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    067acf28
    block: Fix blockdev-snapshot error handling
    Kevin Wolf authored
    
    
    For blockdev-snapshot, external_snapshot_prepare() accepts an arbitrary
    node reference at first and only checks later whether it already has a
    backing file. Between those places, other errors can occur.
    
    Therefore checking in external_snapshot_abort() whether state->new_bs
    has a backing file is not sufficient to tell whether bdrv_append() was
    already completed or not. Trying to undo the bdrv_append() when it
    wasn't even executed is wrong.
    
    Introduce a new boolean flag in the state to fix this.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Loading