Re: /proc/misc has bad mode

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


Andries.Brouwer@cwi.nl wrote:
>
>Matthias Urlichs:
>
>Yes, /etc/mtab has
> /tmp/fdimage /mnt msdos rw,loop=3D/dev/loop0,blocksize=3D1024 0 0
> /dev/cdrom /cd iso9660 ro,noexec,nosuid,nodev,unhide 0 0
>where /proc/mounts has
> /dev/loop0 /mnt msdos rw 0 0
> /dev/cdrom /cd iso9660 ro,noexec,nosuid,nodev 0 0
>
>It follows that /proc/mounts cannot yet replace /etc/mtab -
>some mount options are invisible in /proc/mounts.

Well, I never use "unhide", I patched my loopback device and my mount
binary so that closing or unmounting /dev/loop? automatically disassoci=
ates
the device from the file, and I only mount /path/to/disks/name under
/file/name, so that's not a problem for me. ;-)

IMHO it is a mistake for /dev/loop? to remember its association to a fi=
le
after it's closed. What for? Presumably, after the program which uses i=
t is
done, it's done, and instead of "loattach FILE DEVICE; program argument=
s;
lodetach DEVICE" we can simply add an execvp() call at the end of loatt=
ach
and write "loattach DEVICE FILE program arguments". Or whatever. That w=
ould
have the added benefit to not require umount to depend on correct conte=
nts
of /proc/mounts or /etc/mtab.

The only problem with this would be a program which believes in closing=
all
file descriptors it doesn't want to know about, but these are a major p=
ain
in the ass anyway (just try to use a Makefile which calls ssh).

>Three months ago or so I submitted a correct /proc/mounttable
>and /proc/swaptable, but since it was not used, I must now
>leave it to others to polish /proc/mounts (and add /proc/swaps (ugh)).
>
Do you still have that patch? I'm interested.

--=20
I'll pick up my papers,
and smile at the sky.
I know that the hypnotized
never lie.
--=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