All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 0/3] scsi: infinite guest hangs with scsi-disk
Date: Mon, 16 Nov 2020 19:31:11 +0100	[thread overview]
Message-ID: <20201116183114.55703-1-hare@suse.de> (raw)

Hi all,

one of our customers reported an infinite guest hang following an FC link loss  when using scsi-disk.
Problem is that scsi-disk issues SG_IO command with a timeout of UINT_MAX, which essentially signals
'no timeout' to the host kernel. So if the command gets lost eg during an unexpected link loss the
HBA driver will never attempt to abort or return the command. Hence the guest will hang forever, and
the only way to resolve things is to reboot the host.

To solve it this patchset adds an 'io_timeout' parameter to scsi-disk and scsi-generic, which allows
the admin to specify a command timeout for SG_IO request. It is initialized to 30 seconds to avoid the
infinite hang as mentioned above.

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
  virtio-scsi: trace events
  scsi: make io_timeout configurable
  scsi: add tracing for SG_IO commands

 hw/scsi/scsi-disk.c    |  9 ++++++---
 hw/scsi/scsi-generic.c | 25 ++++++++++++++++++-------
 hw/scsi/trace-events   | 13 +++++++++++++
 hw/scsi/virtio-scsi.c  | 30 +++++++++++++++++++++++++++++-
 include/hw/scsi/scsi.h |  4 +++-
 5 files changed, 69 insertions(+), 12 deletions(-)

-- 
2.16.4



             reply	other threads:[~2020-11-16 19:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 18:31 Hannes Reinecke [this message]
2020-11-16 18:31 ` [PATCH 1/3] virtio-scsi: trace events Hannes Reinecke
2020-11-16 18:31 ` [PATCH 2/3] scsi: make io_timeout configurable Hannes Reinecke
2021-09-20 18:56   ` Paolo Bonzini
2021-09-21  5:39     ` Hannes Reinecke
2021-09-21  7:25       ` Paolo Bonzini
2021-09-22 15:47   ` Philippe Mathieu-Daudé
2021-09-23  6:03     ` Hannes Reinecke
2021-09-23  7:19     ` Paolo Bonzini
2020-11-16 18:31 ` [PATCH 3/3] scsi: add tracing for SG_IO commands Hannes Reinecke
2020-11-16 19:09 ` [PATCH 0/3] scsi: infinite guest hangs with scsi-disk no-reply
2020-12-17 13:49 ` Paolo Bonzini

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=20201116183114.55703-1-hare@suse.de \
    --to=hare@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.