Re: [Utopia] [patch] mount/unmount when starting/stopping



On Tue, 2004-08-17 at 13:43 -0400, Sean Middleditch wrote:
> On Tue, 2004-08-17 at 13:34, David Zeuthen wrote:
> > On Tue, 2004-08-17 at 13:27 -0400, Sean Middleditch wrote:
> > > OK.  So assuming my hardware wasn't designed by idiots, and I'd really
> > > like to be able to just hit Eject and have everything work, is it
> > > currently possible without heavily patching HAL, GVM, etc?
> > > 
> > 
> > 'echo 0 > /proc/sys/dev/cdrom/lock' would do the trick. If the disc is
> > mounted and forcibly removed, then the hal daemon will issue an 'umount
> > -l /dev/cdrom' (lazy unmount) and stuff works. Of course this may crash
> > badly written apps (fd's from files on the mount point will be invalid)
> > but anyone can write a broken app.
> 
> Other than broken apps, are there any other advantages/disadvantages
> compared to having hardware that supports the eject signal stuff?  I
> would personally imagine it being a tad safer to keep the drive locked,
> and if the user requests an ejection, have the system be able to do
> smart things like warn the user that "FooApp is currently accessing the
> device" and let the user cleanly exit the program, or just click on an
> Eject button to eject things anyway (and signal the app that this is
> happening, so it can possible react and do cleanup if it wants), and so
> on.  For example, the app might make a local on-disk cache of the file,
> or just read it all into memory, or just close the document window, or
> whatever.  If the drive just stays unlocked, there won't ever be able to
> be this warning window with a confirmation.
> 

Yah, I agree the warning dialog is a sweet idea. I think that the way
this needs to be addressed is at the kernel level with the kernel only
locking the drive when there are open file descriptors - ideally the
kernel would signal the lock/unlock to userspace via Robert's planned D-
BUS into kernel work and the hal daemon could maintain a property based
on this. 

Btw, Alan Cox's volumagic prototype work does all this completely in
userspace via userspace NFS servers.

Cheers,
David



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]