Re: [PATCH] root-hopping for pre-2.3.41-3

From: Guest section DW (dwguest@win.tue.nl)
Date: Tue Jan 25 2000 - 19:16:02 EST


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@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:16 EST