Commit e80ca772 by Stéphane Graber

Merge pull request #846 from hallyn/2016-02-24/cgns.auto

cgfs: do not automount if cgroup namespaces are supported
parents 4f97fce4 4608594e
...@@ -912,7 +912,7 @@ proc proc proc nodev,noexec,nosuid 0 0 ...@@ -912,7 +912,7 @@ proc proc proc nodev,noexec,nosuid 0 0
the container's own cgroup into that directory. the container's own cgroup into that directory.
The container will be able to write to its own The container will be able to write to its own
cgroup directory, but not the parents, since they cgroup directory, but not the parents, since they
will be remounted read-only will be remounted read-only.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
...@@ -987,6 +987,12 @@ proc proc proc nodev,noexec,nosuid 0 0 ...@@ -987,6 +987,12 @@ proc proc proc nodev,noexec,nosuid 0 0
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para> <para>
If cgroup namespaces are enabled, then any <option>cgroup</option>
auto-mounting request will be ignored, since the container can
mount the filesystems itself, and automounting can confuse the
container init.
</para>
<para>
Note that if automatic mounting of the cgroup filesystem Note that if automatic mounting of the cgroup filesystem
is enabled, the tmpfs under is enabled, the tmpfs under
<filename>/sys/fs/cgroup</filename> will always be <filename>/sys/fs/cgroup</filename> will always be
......
...@@ -1356,6 +1356,9 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type) ...@@ -1356,6 +1356,9 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type)
struct cgroup_process_info *info, *base_info; struct cgroup_process_info *info, *base_info;
int r, saved_errno = 0; int r, saved_errno = 0;
if (cgns_supported())
return true;
cgfs_d = hdata; cgfs_d = hdata;
if (!cgfs_d) if (!cgfs_d)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment