On Fri, 15 Feb 2008, tike64 wrote:

> Hello all you there,
> 
> I have an annoying problem: When I have an USB memory stick attached
> and then detach it while I have a file open on it, the device node is
> left reserved even if it disappears from the /dev dir. If the device
> node was /dev/sda then next time it would be /dev/sdb. Additional
> symptom is that the related scsi_eh_? process doesn't die.
> 
> Searching for a solution I found one other similar incident but no
> solution.
> 
> The kernel is 2.6.18 on ARM LH7A400 and the system is build with
> buildroot. The USB host is implemented with ISP1160.
> 
> Is this clearly a problem in the Linux USB subsystem or is it
> possible that the user space could cause this kind of phenomenon?

It isn't a problem at all; it is the desired behavior.  As long as the
file remains open, the kernel has to maintain the device node
(internally if not externally) and the SCSI error-handler process.  
Thus the node name is not available for new devices to use.

> Should I try a newer kernel? Could someone confirm that it should
> make a difference?

It will not make a difference.

> Is there some kind of workaround?

Yes indeed: Close the open files and unmount the filesystem before
unplugging the memory stick.  This is just good practice in any case; 
if you don't follow it then you risk losing data.

> How could/should I debug this?

No need.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to