Netdev List
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Jia Jia <physicalmtea@gmail.com>,
	mst@redhat.com, jasowangio@gmail.com, pbonzini@redhat.com,
	stefanha@redhat.com, eperezma@redhat.com
Cc: virtualization@lists.linux.dev, kvm@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vhost-scsi: do not relock event vq mutex on send_evt fallback
Date: Mon, 14 Sep 2026 15:58:46 -0500	[thread overview]
Message-ID: <d8371b56-3d75-401b-99ed-746930315af1@oracle.com> (raw)
In-Reply-To: <20260912090420.47439-1-physicalmtea@gmail.com>

On 9/12/26 4:04 AM, Jia Jia wrote:
> vhost_scsi_send_evt() is called with the event virtqueue mutex held.
> If the worker is gone, the fallback currently calls
> vhost_scsi_complete_events(), which tries to acquire the same mutex again
> and deadlocks the caller.
> 
> Split event completion into a helper for callers that already hold the
> mutex and a locking wrapper for the event worker. Use the helper on the
> fallback path.
> 
> Link: https://lore.kernel.org/all/20260905005352.1E5B01F00A3D@smtp.kernel.org/
> Fixes: b1b2ce58ed23 ("vhost-scsi: Handle vhost_vq_work_queue failures for events")
> Signed-off-by: Jia Jia <physicalmtea@gmail.com>
> ---
> Sashiko AI flagged this while reviewing
> the vhost-scsi event queue fix.
> This is a pre-existing self-deadlock. It was reproduced in a follow-up test.
> 
> Trigger: vq->worker == NULL. vhost_vq_work_queue() then returns false,
> and a subsequent vhost_scsi_do_plug() call deadlocks. I do not know what
> normal condition gets us here; the normal vhost-scsi worker detach/reset
> paths do not reach this code. The only reproduction I could come up with
> was killing the vhost-scsi worker. This still looks like a low-probability
> condition.

Reviewed-by: Mike Christie <michael.christie@oracle.com>

      reply	other threads:[~2026-09-14 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12  9:04 [PATCH] vhost-scsi: do not relock event vq mutex on send_evt fallback Jia Jia
2026-09-14 20:58 ` Mike Christie [this message]

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=d8371b56-3d75-401b-99ed-746930315af1@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=physicalmtea@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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