On Fri, Jun 16, 2000 at 02:15:32PM +0100, Tigran Aivazian wrote:
> while we are on the subject of obsoleting /etc/mtab in favour of
> /proc/mounts (or enhanced version thereof), please keep in mind the
> classical problem of "mount -o loop" stopping to work if you use
> /proc/mounts. I think Andries Brouwer explained in the past why was that
> the case but I can't remember the reason. The problem was that loopback
> module's refcount will leak (up) when using /proc/mounts unless you
> manually losetup -d appropriate number of times.

oh, the reason is pretty straightforward: mount(8) writes `loop' into the
mount options if /etc/mtab isn't a symlink to /proc/mounts.  if it is,
it can't modify /proc/mounts.  umount(8) will automatically delete the
underlying loop device if the `loop' keyword is there.

i suspect it doesn't autodelete the device based on the device matching
/dev/lo* because the user may have set it up by hand and be very unhappy
about mount trying to be too clever and delete it.

so mount could keep a /etc/mtab2 to record this informatoin, but that's
freaking ugly.  or we could pass a new mount option down into the kernel
which causes it to display `loop' in that entry, bu this seems like a
waste of a bit.  other alternatives gladly sought.

something i hope to get time to look at next week is redoing the loop
device to take advantage of the LVM hooks.  it might be significantly
faster than the current system.

-- 
The Sex Pistols were revolutionaries.  The Bay City Rollers weren't.

Reply via email to