Repository: mesos Updated Branches: refs/heads/master a8ff88e7f -> ee7496ad8
Updated aufs mount with `rw` and `ro+wh` options. Review: https://reviews.apache.org/r/52254/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ee7496ad Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ee7496ad Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ee7496ad Branch: refs/heads/master Commit: ee7496ad8fba889438fe63dadc11c1ca2068d304 Parents: a8ff88e Author: Qian Zhang <zhang...@cn.ibm.com> Authored: Tue Oct 18 22:36:25 2016 -0700 Committer: Jie Yu <yujie....@gmail.com> Committed: Tue Oct 18 22:36:25 2016 -0700 ---------------------------------------------------------------------- .../mesos/provisioner/backends/aufs.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ee7496ad/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp b/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp index c69dc42..c92c6c7 100644 --- a/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp +++ b/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp @@ -145,12 +145,16 @@ Future<Nothing> AufsBackendProcess::provision( // See http://aufs.sourceforge.net/aufs2/man.html // for the mount syntax for aufs. - string options = "dirs=" + workdir + ":"; - - // For aufs, the specified lower directories will be stacked - // beginning from the rightmost one and going left. But we need the - // first layer in the vector to be the bottom most layer. - options += strings::join(":", adaptor::reverse(layers)); + string options = "dirs=" + workdir + "=rw"; + + // For aufs, the specified lower directories will be stacked beginning + // from the rightmost one and going left. But we need the first layer + // in the vector to be the bottom most layer. And for each layer, we + // need to mount it with the option 'ro+wh' so that it will be read-only + // and its whiteout files (if any) will be well handled. + foreach (const string& layer, adaptor::reverse(layers)) { + options += ":" + layer + "=ro+wh"; + } VLOG(1) << "Provisioning image rootfs with aufs: '" << options << "'";