From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Hannes Reinecke <hare@suse.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 1/3] scsi: allow state transition CREATED_BLOCK -> TRANSPORT_OFFLINE
Date: Thu, 10 Aug 2017 07:31:15 -0700 [thread overview]
Message-ID: <1502375475.2736.18.camel@HansenPartnership.com> (raw)
In-Reply-To: <1502348731-63534-2-git-send-email-hare@suse.de>
On Thu, 2017-08-10 at 09:05 +0200, Hannes Reinecke wrote:
> scsi_internal_device_unblock_nowait() allows a state transition
> SDEV_CREATED_BLOCK -> SDEV_TRANSPORT_OFFLINE/SDEV_OFFLINE,
> scsi_device_set_state() does not.
> So add the missing state transition to scsi_device_set_state().
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/scsi/scsi_lib.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 41c19c7..1ae531b 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -2599,6 +2599,7 @@ void scsi_exit_queue(void)
> case SDEV_RUNNING:
> case SDEV_QUIESCE:
> case SDEV_BLOCK:
> + case SDEV_CREATED_BLOCK:
> break;
> default:
> goto illegal;
This isn't quite good enough: a device that went CREATE_BLOCK ->
OFFLINE, the queue will still be stopped meaning I/O will pile up in it
forever and it won't restart when the device is brought online. It we
need to set the queue running again so that the now offline device
errors all pending I/O. It looks like this is a bug in BLOCK->OFFLINE
too.
We can't simply call scsi_start_queue() from within
scsi_device_set_state() because we may have a lock recursion problem,
so we might have to introduce a new state that allows the queue to be
restarted in the caller.
James
next prev parent reply other threads:[~2017-08-10 14:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 7:05 [PATCH 0/3] scsi: pollable 'state' attribute Hannes Reinecke
2017-08-10 7:05 ` [PATCH 1/3] scsi: allow state transition CREATED_BLOCK -> TRANSPORT_OFFLINE Hannes Reinecke
2017-08-10 7:09 ` Johannes Thumshirn
2017-08-10 9:26 ` Christoph Hellwig
2017-08-10 14:31 ` James Bottomley [this message]
2017-08-10 7:05 ` [PATCH 2/3] scsi_lib: rework scsi_internal_device_unblock_nowait() Hannes Reinecke
2017-08-10 7:11 ` Johannes Thumshirn
2017-08-10 9:27 ` Christoph Hellwig
2017-08-11 3:31 ` kbuild test robot
2017-08-10 7:05 ` [PATCH 3/3] scsi: make 'state' device attribute pollable Hannes Reinecke
2017-08-10 7:19 ` Johannes Thumshirn
2017-08-10 9:27 ` Christoph Hellwig
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=1502375475.2736.18.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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