Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: usb flash drive removal (Re: Desktop NetBSD needs your help)



On Wed, Feb 11, 2009 at 11:02:31PM +0200, Antti Kantee wrote:
> > >> On Tue, Feb 10, 2009 at 5:23 AM, David Holland
> > >> <dholland-current%netbsd.org@localhost> wrote:
> > >>>
> > >>> None of them, however, are Unix-derived. It is a disgrace that
> > >>> removable media handling in Unix has remained broken all this time.
> 
> Yes, rewriting our entire OS is not easy.  Plus I don't think it
> would the way to go anyway.
> 
> > >> I can't wait to use the patch you'll provide!
> > >
> > > Maybe we should add it to the Google Summer of Code project list.
> > >
> > > Jared
> > >
> > 
> > It is already there:
> > http://www.netbsd.org/contrib/soc-projects.html#disk-removal
> 
> I think suggesting this to a student is an even worse idea than
> just doing it.  The student needs very extensive knowledge about
> kernel locking and the implications of blocking block device
> operations for an arbitrary time and will most likely be frustrated
> after the initial code is written and the system should actually
> do something useful.  One problem I pointed out yesterday offline
> is that you need to block while holding locks (e.g. a vnode/inode
> lock) in the pseudo-block driver and this will most likely hang
> the system.  So you need to back out to a level high enough and
> retry or allow access meanwhile otherwise.

Do you mean that it will hang the system, which ordinarily will
not be acceptable, or do you mean that it will hang access to the
affected block device?  I thought that you had said that it was
the latter in a follow-up conversation.

> If you say it's acceptable to block before the device is reconnected,
> how do you deal with e.g. the UI notification component which was
> supposed to alert about accidental device unblock hanging on the
> unplugged file system.

It is acceptable to block access to the device before the device is
reconnected.  It seems to me that a UI notification component will only
hang if it uses resources on the very same disconnected device as it
reports on, but this brings us back to my previous question.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index