[BusyBox] Banging on mount...

Rob Landley rob at landley.net
Sun May 15 04:29:00 UTC 2005


You know, we call erase_mtab() when we successfully mount a new block device 
to delete any "stale entries", except that's not right.  You can have the 
same block device mounted in many different places on a modern linux kernel, 
and this works fine.  (It's a subset of --bind mounts, really.)

I'm treating this as one more bug my rewrite fixes, although I'd like to point 
out that using a file-based mtab at all these days is probably inadviseable 
since we've got most of the infrastructure in place for per-process 
namespaces.  Meaning the symlink to /proc/mounts could become required at 
some point in the future so that you.

Not to mention the fact I've mounted stuff in chroot environments and file 
based mtab falls out of sync, and I overlaid a usermode linux instance 
(running /bin/sh as init) with the root filesystem mounted read/write as 
hostfs and its mounts didn't show up in the parent kernel at all (find with 
UML's procfs overmounted on /proc, but it causes lots of grief if /etc/mtab 
is a file)...  I've probably broken it other ways too, I just don't remember 
what they were at the moment...

Meanwhile /proc/mounts never gets out of sync because it _is_ the kernel view 
of the filesystem.  Oh well.  (Yes, I fixed it so loopback mounts umount 
properly with /etc/mtab symlinked to /proc/mmounts. :)

Rob



More information about the busybox mailing list