linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: BUG: CD driver sends command during host removal
@ 2004-10-11 19:20 Alan Stern
  2004-10-11 19:36 ` James Bottomley
  0 siblings, 1 reply; 28+ messages in thread
From: Alan Stern @ 2004-10-11 19:20 UTC (permalink / raw)
  To: James Bottomley; +Cc: Mike Anderson, SCSI development list

James Bottomley [James.Bottomley@SteelEye.com] wrote:

> On Wed, 2004-09-29 at 16:31, Mike Anderson wrote:
> > James Bottomley [James.Bottomley@SteelEye.com] wrote:
> > > Once you've called scsi_remove_host() the mid-layer will take control of
> > > your in-flight commands (if there are any) and error them back to the
> > > user.  You need to take any actions to clean up internal structures
> > > belonging to the commands *before* you do a scsi_remove_host.
> > > 
> > 
> > How do we address the problem we get into with the reordering in
> > scsi_remove_host (i.e. the call to scsi_forget_host prior to
> > scsi_host_cancel) if we possibly generate new io from sd_sync_cache
> > that will cause the error handler to fire up if the LLDD just lets the
> > command fall on the floor with no response.
> 
> 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?

Alan Stern


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2004-10-11 23:13 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040926082926.GA1944@uniball>
2004-09-27 18:18 ` BUG: CD driver sends command during host removal 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
2004-10-11 19:20 Alan Stern
2004-10-11 19:36 ` James Bottomley
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

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).