Re: loop/mount - was: Re: /proc/misc has bad mode

Matthias Urlichs (smurf@smurf.noris.de)
Tue, 23 Apr 1996 22:14:10 +0200 (MET DST)


Hi,

Andries.Brouwer@cwi.nl wrote:
>
> I patched my loopback device and my mount binary
> so that closing or unmounting /dev/loop? automatically
> disassociates the device from the file.
>
>No patch required, that is the default behaviour of the current mount.

No, that's the default behavior of the current umount. That behavior
currently depends on a correct /etc/mtab, though presumably it could do=
a
stat() on the mount point instead, and find the loop device that way.

We can do things either way, of course, but I do like my way better.
Umount should be able to undo whatever it is mount does by doing a simp=
le
umount(2) system call.

Consider am "emergency" reboot, for instance because something killed t=
he
root partition (these things happen, you know) or because a power failu=
re
is immanent and some process failed to shutdown in an orderly manner
(happens too).
The fast way is to kill all processes, turn off all swap, and unmount
everything in /proc/mounts in reverse order. Easy. But not at all easy =
if
umount must do special things for some file systems. It shouldn't have =
to.

--=20
You will meet a gin-soaked bar-room queen in Memphis.
--=20
Matthias Urlichs \ Noris Network GmbH i.Gr/ Xlink-POP N=FCrnberg=
=20
Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@nor=
is.de
90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc'i=
ng
PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE=20
Click <A HREF=3D"http://smurf.noris.de/~smurf/finger">here</A>. =
42