summaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2024-03-15 19:47:03 -0500
committerMichael S. Tsirkin <mst@redhat.com>2024-05-22 08:31:15 -0400
commit0352c961cb3542b1c03415259d7b85d99457acff (patch)
tree18902ac31dc92a99fdb2f330f4ebfb93a9cfc716 /drivers/vhost
parentd9e59eec4aa7b0c46cec56f4f9cf595ea209da7e (diff)
downloadlwn-0352c961cb3542b1c03415259d7b85d99457acff.tar.gz
lwn-0352c961cb3542b1c03415259d7b85d99457acff.zip
vhost_scsi: Handle vhost_vq_work_queue failures for TMFs
vhost_vq_work_queue will never fail when queueing the TMF's response handling because a guest can only send us TMFs when the device is fully setup so there is always a worker at that time. In the next patches we will modify the worker code so it handles SIGKILL by exiting before outstanding commands/TMFs have sent their responses. In that case vhost_vq_work_queue can fail when we try to send a response. This has us just free the TMF's resources since at this time the guest won't be able to get a response even if we could send it. Signed-off-by: Mike Christie <michael.christie@oracle.com> Message-Id: <20240316004707.45557-6-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/scsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 04e0d3f1bd77..006ffacf1c56 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1309,7 +1309,8 @@ static void vhost_scsi_tmf_flush_work(struct work_struct *work)
* send our response.
*/
vhost_dev_flush(vq->dev);
- vhost_vq_work_queue(vq, &tmf->vwork);
+ if (!vhost_vq_work_queue(vq, &tmf->vwork))
+ vhost_scsi_release_tmf_res(tmf);
}
static void