diff options
author | Stefan Hajnoczi | 2018-01-04 15:25:02 +0100 |
---|---|---|
committer | Paolo Bonzini | 2018-01-16 14:54:50 +0100 |
commit | 24355b79bdaf6ab12f7c610b032fc35ec045cd55 (patch) | |
tree | a823bbf47f289882dbaf508eb6054f437fd71b85 /hw/scsi/scsi-disk.c | |
parent | disas/s390: fix global-buffer-overflow (diff) | |
download | qemu-24355b79bdaf6ab12f7c610b032fc35ec045cd55.tar.gz qemu-24355b79bdaf6ab12f7c610b032fc35ec045cd55.tar.xz qemu-24355b79bdaf6ab12f7c610b032fc35ec045cd55.zip |
scsi-disk: release AioContext in unaligned WRITE SAME case
scsi_write_same_complete() can retry the write if the request was
unaligned. Make sure to release the AioContext when that code path is
taken!
This patch fixes a hang when QEMU terminates after an unaligned WRITE
SAME request has been processed with dataplane. The hang occurs because
iothread_stop_all() cannot acquire the AioContext lock that was leaked
by the IOThread in scsi_write_same_complete().
Fixes: b9e413dd37 ("block: explicitly acquire aiocontext in aio callbacks that need it").
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-stable@nongnu.org
Reported-by: Cong Li <coli@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180104142502.15175-1-stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-disk.c')
-rw-r--r-- | hw/scsi/scsi-disk.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e58833a087..49d2559d93 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1755,6 +1755,7 @@ static void scsi_write_same_complete(void *opaque, int ret) data->sector << BDRV_SECTOR_BITS, &data->qiov, 0, scsi_write_same_complete, data); + aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); return; } |