[PATCH] root-hopping for pre-2.3.41-3
Guest section DW
dwguest en win.tue.nl
Mie Ene 26 06:26:06 CST 2000
On Tue, Jan 25, 2000 H. Peter Anvin wrote:
------------------------------------------------------------------
pivot_root("new_root", "old_root");
This will detach the path "new_root" and turn it into the new root,
and *then* attach the *old* root, now detached, to the path
"old_root", which must be a valid mount point (i.e. directory) in the
new root.
------------------------------------------------------------------
Excellent!
[But let us be careful. Mounting a filesystem is taking a path /path
and letting it be an alias for the root directory of the filesystem.
Some Unix flavours allow overmounting, where more than one filesystem
is mounted on the same path - maybe Linux doesnt allow that today,
it didnt last time I checked, but still I suppose it would be good
to define the semantics of pivot_root() in such a case.]
Werner added:
> > > ... with an implicit "chroot everybody on / to /new_root". That would
> > > solve a few problems, yes. I'll give it a try.
and Peter answered
> > Right... everyone on the old / move to the new /, although I guess
> > that's technically not 100% necessary.
but I wonder.
Usually in such a situation not many processes will be around, but still..
It would be strange if the interpretation of paths suddenly changed for
processes other than the one doing this pivot_root.
So, I would prefer these old processes all to remain where they are,
with the same root inode (that just got a new name, namely /old_root).
Thus, the only process that would get the new / as root would be the
process doing this pivot_root() (and perhaps init?).
Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda