From: James Bottomley <James.Bottomley@SteelEye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 1/5] SCSI scanning and removal fixes
Date: Fri, 09 Sep 2005 09:44:57 -0500 [thread overview]
Message-ID: <1126277097.4799.12.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0509091000480.4945-100000@iolanthe.rowland.org>
On Fri, 2005-09-09 at 10:16 -0400, Alan Stern wrote:
> I see. You must be making an unstated assumption, something along the
> lines of "If the error handler is running then the host is in a *RECOVERY
> state." Given that, there definitely is a need for a separate
> CANCEL_RECOVERY and DEL_RECOVERY.
Sorry, yes ... it wasn't stated because I thought it was apparent in the
diagram.
> Hmmm, well looking through the patch you posted yesterday, there are a few
> problems. If the ->CANCEL transition fails, scsi_remove_host then tries
> ->CANCEL_RECOVERY. But the failed transition still writes a error message
> to the log, even though it's not really an error.
Well ... the log is just that, a log. It's not active unless someone
asks to see it and all its entries don't necessarily represent errors.
However, we can probably tone down the logging to KERN_NOTICE.
> Also, you've got a race between scsi_remove_host doing ->CANCEL_RECOVERY
> and the error handler doing ->RUNNING. If both happen at the same time,
> you can end up in the wrong state. To make this work, the state
> transitions should only be made under protection of the host's spinlock.
> And to avoid the error messages, the choice of next state should be made
> depending on the current state (like, if the current state is RECOVERY
> then go to CANCEL_RECOVERY, otherwise go to CANCEL).
Yes ... we definitely use the lock for device transitions. Since all of
this is done with user context, a semaphore would be the most
appropriate, but since we already have a host lock, it's probably better
to use it.
So which way do you want to go? Either we wait in recovery for the
error handler to finish and transition the host state to RUNNING or we
introduce the parallel states for the error handler.
James
next prev parent reply other threads:[~2005-09-09 14:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 14:12 [PATCH 1/5] SCSI scanning and removal fixes Alan Stern
2005-09-07 15:16 ` James Bottomley
2005-09-07 18:27 ` Alan Stern
2005-09-07 18:37 ` Luben Tuikov
2005-09-07 18:42 ` Luben Tuikov
2005-09-07 19:31 ` Alan Stern
2005-09-07 20:00 ` Mike Anderson
2005-09-07 20:43 ` Luben Tuikov
2005-09-07 21:34 ` Stefan Richter
2005-09-08 15:19 ` Alan Stern
2005-09-08 16:07 ` Luben Tuikov
2005-09-08 18:36 ` Alan Stern
2005-09-08 23:59 ` Luben Tuikov
2005-09-09 14:44 ` Alan Stern
2005-09-09 17:08 ` Stefan Richter
2005-09-09 17:15 ` Luben Tuikov
2005-09-07 19:58 ` James Bottomley
2005-09-07 22:05 ` James Bottomley
2005-09-08 15:59 ` Alan Stern
2005-09-08 16:15 ` James Bottomley
2005-09-08 18:58 ` Alan Stern
2005-09-08 20:15 ` James Bottomley
2005-09-09 0:18 ` Luben Tuikov
2005-09-09 14:16 ` Alan Stern
2005-09-09 14:44 ` James Bottomley [this message]
2005-09-09 15:16 ` Alan Stern
2005-09-09 15:37 ` James Bottomley
2005-09-09 16:17 ` Alan Stern
2005-09-09 16:47 ` Mike Anderson
2005-09-08 16:08 ` Alan Stern
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=1126277097.4799.12.camel@mulgrave \
--to=james.bottomley@steeleye.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