• P
    scsi-disk: handle io_canceled uniformly and correctly · a8b090ef
    Paolo Bonzini 提交于
    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: NPaolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 0c92e0e6)
    Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
    a8b090ef
scsi-disk.c 74.5 KB