Added backport of MESOS-6002 to 1.1.x.

Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/14355b75
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/14355b75
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/14355b75

Branch: refs/heads/1.1.x
Commit: 14355b757ac0dd39db1928c00cb9dad5fd2deb65
Parents: b7f0bc1
Author: Qian Zhang <zhq527...@gmail.com>
Authored: Wed Nov 23 20:41:10 2016 +0800
Committer: Qian Zhang <zhq527...@gmail.com>
Committed: Thu Nov 24 09:37:56 2016 +0800

----------------------------------------------------------------------
 .../mesos/provisioner/backends/aufs.cpp             | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/14355b75/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 << "'";
 

Reply via email to