I took a look at scsi_host_cancel(), scsi_device_cancel(), and a few other
routines. Three things stood out:
When a host is removed, currently executing requests are
aborted within the midlevel but the low-level driver is not
informed of this. Presumably it shouldn't ca
On Fri, May 14, 2004 at 05:13:38PM -0400, Alan Stern wrote:
> I'll work on a patch. Testing it won't be easy, though; it's hard to
> prove that a race _isn't_ happening!
I'm going to have to repeat this tests a few more times (in fact, I'll
boot -mm2 in a couple of minutes to see if I can reprod
On 14 May 2004, James Bottomley wrote:
> The idea behind scsi_remove_host() was that it was going to be called
> from the module_exit() routine. This means that the reference count on
> the LLD has already dropped to zero and it's safe for removal.
>
> If you call scsi_remove_host() outside of t
On Fri, 2004-05-14 at 14:33, Alan Stern wrote:
> usb-storage checks the state of its kernel thread after calling
> scsi_remove_host(), while preparing to kill the thread. This can only
> be done while the thread is idle, not processing any queued commands or
> error handler requests. The BUG in A
On Fri, 14 May 2004, Mike Anderson wrote:
> I was incorrect in my previous statement. Well we may hold a reference
> count on the struct device passed into the scsi_add_host until all
> references on the host instance are gone and there maybe a positive ref
> count on the hostt module until all de
Alan Stern [EMAIL PROTECTED] wrote:
> On Thu, 13 May 2004, Mike Anderson wrote:
>
> > The LLDD queuecommand should not be called after the return of
> > scsi_remove_host (unless we have a bug). The LLDD should not free its
> > resources until the release function is called on the struct device
> >
On Thu, 13 May 2004, Mike Anderson wrote:
> The LLDD queuecommand should not be called after the return of
> scsi_remove_host (unless we have a bug). The LLDD should not free its
> resources until the release function is called on the struct device
> passed in during the scsi_add_host call.
Ah.
Alan Stern [EMAIL PROTECTED] wrote:
> This BUG happened because the SCSI layer was still using the drive after
> usb-storage had called scsi_remove_host().
In this case the scsi_remove_host is being called in a unexpected
disconnect case. Any IOs in flight will be canceled in the mid-layer
(i.e.,
On Thu, 13 May 2004, Alberto Bertogli wrote:
> Hi!
>
> I've just hit a bug after removing a Kingston USB flash drive.
>
> I have removed it several (probably more than 40) times today without
> problems until now. I'm removing it while doing streaming write()s on
> the device (using /dev/sda) be