linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Mike Anderson <andmike@us.ibm.com>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: BUG: CD driver sends command during host removal
Date: 11 Oct 2004 14:36:09 -0500	[thread overview]
Message-ID: <1097523375.1714.167.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0410111513400.21084-100000@netrider.rowland.org>

On Mon, 2004-10-11 at 14:20, Alan Stern wrote:
> James Bottomley [James.Bottomley@SteelEye.com] wrote:
> > That's why LLD's are responsible for erroring all commands issued at
> > this time if the removal is a surprise ejection.  The commands have to
> > be errored in a way (like DID_NO_CONNECT) that won't excite the error
> > handler.
> 
> This raises a question for the case where the host removal is not a
> surprise ejection.  The LLD knows to clean up commands from _before_ doing
> scsi_remove_host, and it knows that it should handle commands from _after_
> calling scsi_remove_host.
> 
> But scsi_remove_host isn't synchronized at all with queuecommand, so what
> about commands that arrive at just about _the same time_ as when
> scsi_remove_host is called?  The LLD has no way to tell which class such a
> command belongs to.  What then?

The host's job is simply to send commands to the device ... if the
device (or host) still exists in the system, you send them; if it
doesn't, you error them.

Even in the notified ejection case, there's no upper bound on the time
it will take hotplug to clean up ... this can be particularly long if
the user has things mounted and doesn't let us simply kill everything on
the filesystem.

So the only difference as far as the HBA sees it is that for notified
ejection, when it calls scsi_remove_host() it can still send commands. 
For surprise ejection, the device is gone and it must error.

James



  reply	other threads:[~2004-10-11 19:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-11 19:20 BUG: CD driver sends command during host removal Alan Stern
2004-10-11 19:36 ` James Bottomley [this message]
2004-10-11 20:03   ` Alan Stern
2004-10-11 20:12     ` James Bottomley
2004-10-11 20:40       ` Mike Anderson
2004-10-11 21:15         ` James Bottomley
2004-10-11 23:13           ` Mike Anderson
     [not found] <20040926082926.GA1944@uniball>
2004-09-27 18:18 ` Alan Stern
2004-09-27 18:51   ` Mohammed Sameer
2004-09-29 16:06   ` Luben Tuikov
2004-09-29 16:55     ` Alan Stern
2004-09-29 17:09       ` Mike Anderson
2004-09-29 18:02       ` Luben Tuikov
2004-09-29 18:09         ` James Bottomley
2004-09-29 18:58           ` Luben Tuikov
2004-09-29 19:39             ` James Bottomley
2004-09-29 19:01         ` Alan Stern
2004-09-29 19:27           ` Mike Anderson
2004-09-29 19:33           ` Luben Tuikov
2004-09-29 19:50           ` James Bottomley
2004-09-29 20:31             ` Mike Anderson
2004-09-29 20:41               ` James Bottomley
2004-09-29 21:07                 ` Mike Anderson
2004-09-29 21:14                   ` James Bottomley
2004-09-29 21:20                     ` Luben Tuikov
2004-09-29 21:26                       ` James Bottomley
2004-09-29 21:20                   ` Alan Stern
2004-10-02 23:57                     ` Mohammed Sameer

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=1097523375.1714.167.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=andmike@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).