]> git.ipfire.org Git - thirdparty/qemu.git/commit
iscsi: fix races between task completion and abort
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 18 Aug 2012 21:35:49 +0000 (23:35 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Aug 2012 06:50:01 +0000 (01:50 -0500)
commit799c27e1243769a52fb3edc7e5b42f9f50c9fba6
treec3865b09ca2bac3803d274d83fcaec861359c332
parentb90d717b6469ac15fa1837a884097bbc5499124c
iscsi: fix races between task completion and abort

This patch fixes two main issues with block/iscsi.c:

1) iscsi_task_mgmt_abort_task_async calls iscsi_scsi_task_cancel which
was also directly called in iscsi_aio_cancel

2) a race between task completion and task abortion could happen cause
the scsi_free_scsi_task were done before iscsi_schedule_bh has finished.
To fix this, all the freeing of IscsiTasks and releasing of the AIOCBs
is centralized in iscsi_bh_cb, independent of whether the SCSI command
has completed or was cancelled.

3) iscsi_aio_cancel was not synchronously waiting for the end of the
command.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 1bd075f29ea6d11853475c7c42734595720c3ac6)

Conflicts:

block/iscsi.c

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/iscsi.c