]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
scsi-disk: handle io_canceled uniformly and correctly
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Feb 2013 11:16:05 +0000 (12:16 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Apr 2013 15:50:28 +0000 (10:50 -0500)
commita8b090ef08872dad68acb2afbb0f81c44c4132e6
tree2fac5ce39fbb623e3d1f6ff871e9482d92368046
parent4a389443262b62ecfd916aea3efc09a502762cd9
scsi-disk: handle io_canceled uniformly and correctly

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: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0c92e0e6b64c9061f7365a2712b9055ea35b52f9)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi-disk.c