Re: [linux-usb-devel] oops on usb storage device disconnect with 2.6.14-rc1

Alan Stern
2005-09-18T02:33:25Z

On Sat, 17 Sep 2005, James Bottomley wrote:

> On Thu, 2005-09-15 at 21:52 -0400, Alan Stern wrote:
> > In short, those iterations must be carried out as in my patch.
>
> OK, I looked at making this work while reaping the target correctly, but
> I couldn't (basic problem is that the target list keeps the target until
> it has no more devices, a condition that could be made untrue by
> something as simple as an open of the sysfs file).

Sorry, I'm a bit slow tonight. I thought you _wanted_ the target to hang
around until it had no more devices. (Wasn't that the whole point of
scsi_target_reap?) What's wrong with keeping the target until the sysfs
file is closed?

> So, rather than try that, I thought a better approach might be to make
> the host state model work for us. i.e. if we know the host is being
> removed, there's no point allowing target or device removal because at
> some point the host removal will do it for us. This enforcement would
> ensure we're the only legitimate removers of the target and device.

How does this make things any better? You still face the problem that an
open sysfs file will delay device removal and target reaping, if all the
devices on that target are hot-unplugged and the host remains alive and
active.

> The alternative is to migrate to klists, I think ...

Think very carefully before taking such a step... :-)

Alan Stern