Skip to content
  • Paolo Bonzini's avatar
    scsi-disk: handle io_canceled uniformly and correctly · 0c92e0e6
    Paolo Bonzini authored
    
    
    Always check it immediately after calling bdrv_acct_done, and
    always do a "goto done" in case the "done" label has to free
    some memory---as is the case for scsi_unmap_complete in the
    previous patch.
    
    This patch could fix problems that happen when a request is
    split into multiple parts, and one of them is canceled.  Then
    the next part is fired, but the HBA's cancellation callbacks have
    fired already.  Whether this happens or not, depends on how the
    block/ driver implements AIO cancellation.  It it does a simple
    bdrv_drain_all() or similar, then it will not have a problem.
    If it only cancels the given AIOCB, this scenario could happen.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    0c92e0e6