From: Luben Tuikov <luben_tuikov@adaptec.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 1/5] SCSI scanning and removal fixes
Date: Wed, 07 Sep 2005 14:37:44 -0400 [thread overview]
Message-ID: <431F3378.8000109@adaptec.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0509071413070.4988-100000@iolanthe.rowland.org>
On 09/07/05 14:27, Alan Stern wrote:
> On Wed, 7 Sep 2005, James Bottomley wrote:
>
>
>>On Tue, 2005-07-26 at 10:12 -0400, Alan Stern wrote:
>>
>>>This patch (as542) fixes a few loose ends left by Mike's patches. It adds
>>>a declaration for the new scsi_host_set_state routine, adds an allowed
>>>transition from the SHOST_RECOVERY state to the SHOST_CANCEL state, and
>>>avoids returning an uninitialized value in __scsi_add_device.
>>
>>The first part (external declaration) is already in.
>>
>>The second (allow RECOVERY->CANCEL) isn't really an answer. The correct
>>thing, I suppose, is to have scsi_remove_host() wait for the error
>>handler to finish if the state transition cannot be accomodated
>>(otherwise the error handler will try to transition ->RUNNING part way
>>through the removal).
>
>
> I'm going to argue strongly about this. scsi_remove_host should _not_
> wait for error recovery to complete -- to do so will invite deadlocks.
> (Suppose the error handler is waiting for a bus reset, but the bus reset
> routine requires a semaphore held by the LLD during the call to
> scsi_remove_host?) Furthermore, error recovery can potentially take quite
> a long time -- much longer than we want to wait during a removal event.
> Instead, the error handler should not be allowed to make the transition to
> RUNNING once the removal has started.
Hey guys,
I haven't looked at Alan's patches in detail, but would just like
to mention that my driver supports hot plugging _and_unplugging_
of devices and _whole_domains_ (many devices at the same time,
plug and unplug).
scsi hosts are also dynamically created and destroyed.
Currently there is absolutely no problems with any deadlocks or anything
like that. (Of course the driver implements its own eh+timeout hooks.)
Make sure you guys do not break something. ;-)
Luben
>
>
>>The third (don't allow uninitialised return from __scsi_add_device) is
>>correct, but the return is universally ignored (the only actual user
>>being ipr). Unfortunately, now I look at this, ipr gets it wrong too.
>>This API currently returns an sdev with an incremented refcount. If you
>>ignore the return, as ipr does, you're leaking refcounts. So, since the
>>only user gets it wrong all the time, I'd vote for modifying the API not
>>to return a device.
>
>
> Changing the API is fine with me, but the existing code is still shaky
> because it calls scsi_alloc_target before checking scsi_host_scan_allowed.
> Maybe that's not an out-and-out mistake, but better to avoid it.
>
> Would you like me to submit an updated patch?
>
> Alan Stern
>
> -
> 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
>
next prev parent reply other threads:[~2005-09-07 18:37 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 [this message]
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
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=431F3378.8000109@adaptec.com \
--to=luben_tuikov@adaptec.com \
--cc=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 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.