linux-stable/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
Kconfig.vringh
Makefile
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
test.h
vhost.c vhost: Use vhost_get_used_size() in vhost_vring_set_addr() 2020-10-14 10:32:58 +02:00
vhost.h
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