A minor problem w/ access to my flash drive

David Zeuthen david at fubar.dk
Mon Jan 24 07:42:50 PST 2005


On Mon, 2005-01-24 at 14:17 +0600, Alexey Morozov wrote:
> Hello!
> 
> Sjoerd Simons writes:
> 
> >  Hal checks every second (or every 2, dunno exactly) if there is a media change
> >  on the driver, this could be the reason your seeing that behaviour.  On my
> >  usbstick is see the light flash everytime hal polls :) 

It shouldn't blink when it's mounted.

> >  
> >
> But why?? I always thought that USB devices have true notification 
> model, so a device exists till appropriate disconnect event is received. 
> Yes, I know, sometimes these connect/disconnects events are sent /almost 
> randomly/ for certain devices (my APC BackUPS CS 500 is one of these), 
> but I never heard that a devices could be unplugged w/o proper 
> notification...
> 

USB device removal != media removal; you definitely have to
poll, see the thread with the subject "removable media
revalidation - udev  vs. devfs or static /dev" on linux-hotplug-devel
about a year ago for some more discussion.

> Is there a way to change this behaviour for this particular type of 
> devices w/o becoming the real HAL hacker? And again this behaviour is 
> device-specific, I just was told that another flash on another computer 
> doesn't behave that way. Unfortunately this computer is 3K km's far 
> away, so I can't change the computer/flash drive combination quickly ;-)
> 

See the .fdi file Poznar posted later in this thread.

> >  The right way is to unmount the driver before pulling it out. When the umount
> >  is finished the data should be safely on the drive.
> >  
> >
> I'm sorry, but this way sucks. 

You have to unmount, sorry, it's unsafe to just removing the device
backing a mounted file system. While HAL can cope this with (as far
as the kernel can) by playing all sorts of lazy unmount tricks it's
still not safe in many ways. If you google around, you'll find the
same comments about Windows and Mac OS X - the former OS decided
to remove the modal "unsafe device removal" dialog, while the latter
does put it up.

> Not only because I have to stop all 
> programs being accessing the device even for read only (including those 
> running in another user session), but also because I have to explain all 
> this to my family which have already got used to, hmm, carelessly pull 
> out all existing removeable devices, from diskettes to still camera. And 
> this works so far... So I'd like to heard how to fix HAL rather than to 
> fix ourselves :-)

Help fix the programs keeping open fd's on a file system instead.

David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list