Skip to content
  • Hanna Reitz's avatar
    705dde27
    backup-top: Refuse I/O in inactive state · 705dde27
    Hanna Reitz authored
    
    
    When the backup-top node transitions from active to inactive in
    bdrv_backup_top_drop(), the BlockCopyState is freed and the filtered
    child is removed, so the node effectively becomes unusable.
    
    However, noone told its I/O functions this, so they will happily
    continue accessing bs->backing and s->bcs.  Prevent that by aborting
    early when s->active is false.
    
    (After the preceding patch, the node should be gone after
    bdrv_backup_top_drop(), so this should largely be a theoretical problem.
    But still, better to be safe than sorry, and also I think it just makes
    sense to check s->active in the I/O functions.)
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-Id: <20210219153348.41861-3-mreitz@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    705dde27
    backup-top: Refuse I/O in inactive state
    Hanna Reitz authored
    
    
    When the backup-top node transitions from active to inactive in
    bdrv_backup_top_drop(), the BlockCopyState is freed and the filtered
    child is removed, so the node effectively becomes unusable.
    
    However, noone told its I/O functions this, so they will happily
    continue accessing bs->backing and s->bcs.  Prevent that by aborting
    early when s->active is false.
    
    (After the preceding patch, the node should be gone after
    bdrv_backup_top_drop(), so this should largely be a theoretical problem.
    But still, better to be safe than sorry, and also I think it just makes
    sense to check s->active in the I/O functions.)
    
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    Message-Id: <20210219153348.41861-3-mreitz@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading