HAL device removal success

David Zeuthen david at fubar.dk
Wed Jan 14 10:45:34 EET 2004


On Wed, 2004-01-14 at 07:02, Matthew Mastracci wrote:
> I tried the latest CVS version of HAL and the device insert/removal
> notification works like a charm!  It easily picks up my insertion of a
> smartmedia card into the correct slot and places it in the device
> manager.  
> 
> The only bugs so far are:
> 
> 1. If the device is removed *while mounted*, it still appears as
> available until you umount it.  I'm not sure yet if this is a kernel or
> HAL bug, however.

It's something that can be fixed in HAL since open("/udev/sda",
O_RDONLY) will return ENOMEDIUM and then HAL can unmount all the
corresponding volumes and then receive the hotplug remove event on the
/udev/sda1 and friends.

I tried this but the kernel started acting funny; I need to investigate
further (currently I poll with the option O_NONBLOCK which doesn't give
the ENOMEDIUM)

>  
> 2. Eventually, I end up getting errno=24 (EMFILE) while scanning
> devices.  Looks like it might be leaking file descriptors:
> 

Yeah my bad, fixed in CVS, thanks. 

Now it works reasonably well with g-v-m except that one still has to
unmount manually after or before unplugging the device. 

Of course should always unmount before, however we should support the
use-case of users unplugging without unmounting. And send desktop policy
engines, like g-v-m, when forcing an unmount so they can act
accordingly; like tell the user to unmount before - or something.

Cheers,
David






More information about the xdg mailing list