From: Mike Christie <michael.christie@oracle.com>
To: oleg@redhat.com, ebiederm@xmission.com,
virtualization@lists.linux-foundation.org, mst@redhat.com,
sgarzare@redhat.com, jasowang@redhat.com, stefanha@redhat.com,
brauner@kernel.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH 5/9] vhost_scsi: Handle vhost_vq_work_queue failures for TMFs
Date: Fri, 15 Mar 2024 19:47:03 -0500 [thread overview]
Message-ID: <20240316004707.45557-6-michael.christie@oracle.com> (raw)
In-Reply-To: <20240316004707.45557-1-michael.christie@oracle.com>
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>
---
drivers/vhost/scsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
--
2.34.1
next prev parent reply other threads:[~2024-03-16 0:47 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 0:46 [PATCH 0/9] vhost: Support SIGKILL by flushing and exiting Mike Christie
2024-03-16 0:46 ` [PATCH 1/9] vhost-scsi: Handle vhost_vq_work_queue failures for events Mike Christie
2024-03-16 0:47 ` [PATCH 2/9] vhost-scsi: Handle vhost_vq_work_queue failures for cmds Mike Christie
2024-03-16 0:47 ` [PATCH 3/9] vhost-scsi: Use system wq to flush dev for TMFs Mike Christie
2024-03-16 0:47 ` [PATCH 4/9] vhost: Remove vhost_vq_flush Mike Christie
2024-03-16 0:47 ` Mike Christie [this message]
2024-03-16 0:47 ` [PATCH 6/9] vhost: Use virtqueue mutex for swapping worker Mike Christie
2024-03-16 0:47 ` [PATCH 7/9] vhost: Release worker mutex during flushes Mike Christie
2024-03-16 0:47 ` [PATCH 8/9] vhost_task: Handle SIGKILL by flushing work and exiting Mike Christie
2024-03-16 0:47 ` [PATCH 9/9] kernel: Remove signal hacks for vhost_tasks Mike Christie
2024-04-09 4:16 ` [PATCH 0/9] vhost: Support SIGKILL by flushing and exiting Jason Wang
2024-04-09 14:57 ` Mike Christie
2024-04-09 16:40 ` Michael S. Tsirkin
2024-04-09 21:55 ` michael.christie
2024-04-10 4:21 ` Michael S. Tsirkin
2024-04-18 7:10 ` Michael S. Tsirkin
2024-04-11 8:39 ` Jason Wang
2024-04-11 16:19 ` Mike Christie
2024-04-12 3:28 ` Jason Wang
2024-04-12 16:52 ` michael.christie
2024-04-15 8:52 ` Jason Wang
2024-04-17 3:50 ` Jason Wang
2024-04-17 16:03 ` Mike Christie
2024-04-18 4:08 ` Jason Wang
2024-04-18 7:07 ` Michael S. Tsirkin
2024-04-18 9:25 ` Andreas Karis
2024-04-19 0:37 ` Jason Wang
2024-04-19 0:40 ` Jason Wang
2024-05-15 6:27 ` Jason Wang
2024-05-15 7:24 ` Michael S. Tsirkin
2024-04-19 0:33 ` Jason Wang
2024-04-18 7:01 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240316004707.45557-6-michael.christie@oracle.com \
--to=michael.christie@oracle.com \
--cc=brauner@kernel.org \
--cc=ebiederm@xmission.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=oleg@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).