1
0
Fork 0
alistair23-linux/drivers/vhost
Mike Christie 8a2ae7fa5d vhost scsi: fix cmd completion race
[ Upstream commit 47a3565e8b ]

We might not do the final se_cmd put from vhost_scsi_complete_cmd_work.
When the last put happens a little later then we could race where
vhost_scsi_complete_cmd_work does vhost_signal, the guest runs and sends
more IO, and vhost_scsi_handle_vq runs but does not find any free cmds.

This patch has us delay completing the cmd until the last lio core ref
is dropped. We then know that once we signal to the guest that the cmd
is completed that if it queues a new command it will find a free cmd.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Link: https://lore.kernel.org/r/1604986403-4931-4-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-02 08:49:48 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.vringh treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net.c vhost: Check docket sk_family instead of call getname 2020-03-05 16:43:44 +01:00
scsi.c vhost scsi: fix cmd completion race 2020-12-02 08:49:48 +01:00
test.c vhost/test: stop device before reset 2019-10-13 09:38:27 -04:00
test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vhost.c vhost: Use vhost_get_used_size() in vhost_vring_set_addr() 2020-10-14 10:32:58 +02:00
vhost.h Revert "vhost: access vq metadata through kernel virtual address" 2019-09-04 07:39:48 -04:00
vringh.c vringh: fix __vringh_iov() when riov and wiov are different 2020-11-05 11:43:35 +01:00
vsock.c vsock/virtio: add transport parameter to the virtio_transport_reset_no_sock() 2020-10-07 08:01:24 +02:00