From 96e0df76334dd87f8821f96da1a502698ef3b221 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Sat, 6 May 2017 07:59:03 +0800 Subject: [PATCH] Fix comments about when to pivot_root Signed-off-by: Qiang Huang --- libcontainer/rootfs_linux.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index d507373f..0ec5864f 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -37,9 +37,8 @@ func needsSetupDev(config *configs.Config) bool { } // prepareRootfs sets up the devices, mount points, and filesystems for use -// inside a new mount namespace. It doesn't set anything as ro or pivot_root, -// because console setup happens inside the caller. You must call -// finalizeRootfs in order to finish the rootfs setup. +// inside a new mount namespace. It doesn't set anything as ro. You must call +// finalizeRootfs after this function to finish setting up the rootfs. func prepareRootfs(pipe io.ReadWriter, config *configs.Config) (err error) { if err := prepareRoot(config); err != nil { return newSystemErrorWithCause(err, "preparing rootfs") @@ -114,8 +113,8 @@ func prepareRootfs(pipe io.ReadWriter, config *configs.Config) (err error) { return nil } -// finalizeRootfs actually switches the root of the process and sets anything -// to ro if necessary. You must call prepareRootfs first. +// finalizeRootfs sets anything to ro if necessary. You must call +// prepareRootfs first. func finalizeRootfs(config *configs.Config) (err error) { // remount dev as ro if specified for _, m := range config.Mounts {