Re: the umount() saga for regular linux desktop users

From: Adrian Bunk
Date: Sun Jan 02 2005 - 15:53:16 EST


On Sun, Jan 02, 2005 at 09:34:16PM +0100, Oliver Neukum wrote:
> Am Sonntag, 2. Januar 2005 21:11 schrieb Adrian Bunk:
> > On Sun, Jan 02, 2005 at 08:37:24PM +0100, Pavel Machek wrote:
> >
> > > Well, umount -l can be handy, but it does not allow you to get your CD
> > > back from the drive.
> > >
> > > umount --kill that kills whoever is responsible for filesystem being
> > > busy would solve part of the problem (that can be done in userspace,
> > > today).
> > >...
> >
> > What's wrong with
> >
> > fuser -k /mnt && umount /mnt
>
> 1. Would need suid.

It needs suid only if you aren't root and you want to kill processes you
don't own.

Yes, this might cause problems e.g. if users are allowed to mount their
cdroms, but simply allowing them to kill processes of other users who
access this device isn't a solution, too.

> 2. Is a mindless slaughter of important processes.

It's what Pavel wanted to get included in umount.

Usually, you'll let fuser give you the list of processes and inspect
them manually.

> 3. Is a race condition.

Then put it into a while loop that executes until umount returns 0.

I still fail to see why I should implement half of fuser in umount.
Either you are working at the command line and know about fuser or you
are working through a GUI which can offer you a "kill all applications
accessing this device" button that calls fuser.

> Regards
> Oliver

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/