]> git.proxmox.com Git - 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)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Aug 2012 13:58:47 +0000 (15:58 +0200)
commit1bd075f29ea6d11853475c7c42734595720c3ac6
tree48ce18410e123fd698e82ef27f7155a28e313deb
parentcfb3f5064af2d2e29c976e292c9472dfe9d61e31
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>
block/iscsi.c