Re: 2.4.19-pre7: rootfs mounted twice

From: Alexander Viro (viro@math.psu.edu)
Date: Fri Apr 26 2002 - 13:46:35 EST


On Sat, 27 Apr 2002, Jeff Chua wrote:

> This happens all the time if you use initrd ramdisk and switch to hard
> disk during boot up.

This happens all the time with rootfs, period. For exactly the same
reasons.

Again, we could hide that fact (we _do_ have a filesystem mounted
underneath the final root), but I'm not sure that it's worth hiding.
The real problem is in the interaction between df(1) and /proc/mounts
and it occurs every time when mountpoint happens to be a root of
already mounted filesystem. Which could happen at any time since
the beginning of 2.4 (actually, way back in 2.3).

Notice that the same bug happens in _all_ version for chroot environment.
Namely, df(1) will try to call statfs() for mountpoints outside chroot
jail and that will give very interesting output, since results were for
corresponsing directories _inside_ the jail.

Arguably, correct way to handle that is to leave everything outside the
process' root out of /proc/mounts. Which would solve both the chroot
problems and rootfs one (all processes are chrooted into the "final"
root). It _still_ doesn't solve the old problem with overmounts, but
that one could be only handled in userland (by letting df(1) notice
that several getmntent(3) have the same mountpoint and ignore all
but the last one).

Unless somebody has a good reason why /proc/mounts in chroot jail should
show objects outside it, I'm going to do it that way.

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



This archive was generated by hypermail 2b29 : Tue Apr 30 2002 - 22:00:13 EST