]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi-disk: release AioContext in unaligned WRITE SAME case
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 4 Jan 2018 14:25:02 +0000 (14:25 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 23 Jan 2018 22:35:01 +0000 (16:35 -0600)
commitccf82aee58424418845c881e1db5ca6d03918112
tree0c439171f15501ef41df3a205d673188217545cc
parent1e14820884c60be71646c8b83f536c209e1205b4
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>
(cherry picked from commit 24355b79bdaf6ab12f7c610b032fc35ec045cd55)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/scsi-disk.c