public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Brian King <brking@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/1] scsi: Add added_to_sysfs sdev flag to fix device scanning oops
Date: Mon, 18 Aug 2008 09:12:07 -0500	[thread overview]
Message-ID: <1219068727.3261.7.camel@localhost.localdomain> (raw)
In-Reply-To: <48A981F0.5030002@linux.vnet.ibm.com>

On Mon, 2008-08-18 at 09:06 -0500, Brian King wrote:
> James Bottomley wrote:
> > What this seems to be exposing is a bug in the state model around the
> > blocked state.
> > 
> > The transition:
> > 
> > CREATED -> BLOCK -> RUNNING
> > 
> > shouldn't be legal.  My initial reaction is just to forbid the CREATED
> > -> BLOCK transition, but it looks like the fc transport code never
> > checks return values from scsi_target_block() (sigh!)
> > 
> > So an alternate fix should be to correct the state model rather than try
> > and work around the deficiencies with additional flags.
> > 
> > It looks like, to allow the CREATED -> BLOCK -> CREATED transition we
> > need an extra state (CREATED_BLOCK) and we forbid the CREATED -> BLOCK
> > in favour of it.
> > 
> > The model also now allows an online transition to do CREATED_BLOCK ->
> > BLOCK
> > 
> > This is a rough code of that, does it work for you?
> 
> I loaded up your patch and this fixes my issue as well. Do we need to also
> add a check for SDEV_CREATED_BLOCK in scsi_dispatch_cmd?

Yes ... everywhere we previously checked for SDEV_BLOCK ... really, that
check now needs to be made into an inline function.  I'll reroll the
patch properly with that included.

James



  reply	other threads:[~2008-08-18 14:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 18:03 [PATCH 1/1] scsi: Add added_to_sysfs sdev flag to fix device scanning oops Brian King
2008-08-15 22:53 ` James Bottomley
2008-08-18 14:06   ` Brian King
2008-08-18 14:12     ` James Bottomley [this message]
2008-08-22 21:43       ` [PATCH 1/2] add inline functions for recognising created and blocked states James Bottomley
2008-08-22 21:53       ` [PATCH 2/2] Update the SCSI state model to allow blocking in the created state James Bottomley

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=1219068727.3261.7.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.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