All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.vnet.ibm.com>
To: emilne@redhat.com
Cc: Bart Van Assche <bart.vanassche@sandisk.com>,
	Wei Fang <fangwei1@huawei.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: avoid a permanent stop of the scsi device's request queue
Date: Wed, 07 Dec 2016 12:09:35 -0800	[thread overview]
Message-ID: <1481141375.2354.53.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <1481138661.28416.238.camel@localhost.localdomain>

On Wed, 2016-12-07 at 14:24 -0500, Ewan D. Milne wrote:
> On Wed, 2016-12-07 at 10:16 -0800, James Bottomley wrote:
> > On Wed, 2016-12-07 at 12:40 -0500, Ewan D. Milne wrote:
> > > On Wed, 2016-12-07 at 08:55 -0800, Bart Van Assche wrote:
> > > > On 12/07/2016 08:48 AM, Bart Van Assche wrote:
> > > > > It's a known bug. Some time ago I posted a patch that 
> > > > > serializes all scsi_device_set_state() calls but I have not 
> > > > > yet found it in the list archives. However, that patch has 
> > > > > not yet been merged.
> > > > 
> > > > See also https://www.spinics.net/lists/linux-scsi/msg66966.html
> > > > .
> > > > 
> > > > Bart.
> > > > 
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux
> > > > -scsi" in
> > > > the body of a message to majordomo@vger.kernel.org
> > > > More majordomo info at  
> > > > http://vger.kernel.org/majordomo-info.html
> > > 
> > > Yes, however that patch does not fix Wei Fang's issue.  In fact I
> > > just received a crash dump that appears to be the same thing.  It
> > > looks like the rport went away right after the initial INQUIRY, 
> > > so we set the state to SDEV_BLOCK and stop the queue, and then 
> > > the scan code continues and sets the state back to SDEV_RUNNING.
> > 
> > So here's the violation of the state model.  the rport went CREATED
> > ->BLOCK which is wrong: it should go CREATED->CREATED_BLOCK and 
> > then the add code would set it to BLOCK instead of RUNNING.
> > 
> > The question to diagnose is why CREATED->BLOCK worked.
> > 
> > James
> > 
> 
> I believe scsi_add_lun() changed the state from CREATED->RUNNING 
> which allowed the state to change from RUNNING->BLOCK, and then
> scsi_sysfs_add_sdev() called scsi_device_set_state() which changed
> the state from BLOCK->RUNNING.  But did not restart the queue.
> 
> I have a debug kernel out to the site that found this to make sure,
> assuming they can reproduce this, but I don't see any other way it 
> could have happened.

Hm, it looks like the state set in scsi_sysfs_add_sdev() is bogus.  We
expect the state to have been properly set before that (in
scsi_add_lun), so can we not simply remove it?

James


  reply	other threads:[~2016-12-07 20:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06  9:12 [PATCH] scsi: avoid a permanent stop of the scsi device's request queue Wei Fang
2016-12-06 15:51 ` Bart Van Assche
2016-12-07  1:20   ` Wei Fang
2016-12-07  2:45     ` Bart Van Assche
2016-12-07  3:41       ` Wei Fang
2016-12-07  4:40         ` Bart Van Assche
2016-12-07  6:59           ` Wei Fang
2016-12-07 16:48             ` Bart Van Assche
2016-12-07 16:55               ` Bart Van Assche
2016-12-07 17:40                 ` Ewan D. Milne
2016-12-07 18:16                   ` James Bottomley
2016-12-07 19:24                     ` Ewan D. Milne
2016-12-07 20:09                       ` James Bottomley [this message]
2016-12-07 20:30                         ` Ewan D. Milne
2016-12-07 23:43                           ` James Bottomley
2016-12-08  2:28                             ` Wei Fang
2016-12-08  2:33                               ` James Bottomley
2016-12-08  3:22                                 ` Wei Fang
2016-12-08  6:38                                   ` Wei Fang
2016-12-08 14:04                                     ` Ewan D. Milne
2016-12-08 15:39                                   ` James Bottomley
2016-12-09  1:08                                     ` Wei Fang

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=1481141375.2354.53.camel@linux.vnet.ibm.com \
    --to=jejb@linux.vnet.ibm.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=emilne@redhat.com \
    --cc=fangwei1@huawei.com \
    --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 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.