vhost scsi: fix cmd completion race
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 <email@example.com>
Reviewed-by: Maurizio Lombardi <firstname.lastname@example.org>
Signed-off-by: Michael S. Tsirkin <email@example.com>
Acked-by: Stefan Hajnoczi <firstname.lastname@example.org>
1 file changed