The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/856

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
…rted

This is not 100% correct, but will suffice until we fix the kernel so that
we can distinguish between bind mounts and namespaced cgroupfs mounts.

Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
From fcca16bc86c3e08439bc4a7b865213689b6e1c12 Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hal...@ubuntu.com>
Date: Fri, 26 Feb 2016 13:35:24 -0800
Subject: [PATCH] cgfs: ignore mount prefix in mountinfo if cgroup namespaces
 are supported

This is not 100% correct, but will suffice until we fix the kernel so that
we can distinguish between bind mounts and namespaced cgroupfs mounts.

Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
---
 src/lxc/cgfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/cgfs.c b/src/lxc/cgfs.c
index 8c1cb64..16c80eb 100644
--- a/src/lxc/cgfs.c
+++ b/src/lxc/cgfs.c
@@ -418,6 +418,7 @@ static bool find_hierarchy_mountpts( struct 
cgroup_meta_data *meta_data, char **
        size_t mount_point_capacity = 0;
        size_t token_capacity = 0;
        int r;
+       bool is_cgns = cgns_supported();
 
        proc_self_mountinfo = fopen_cloexec("/proc/self/mountinfo", "r");
        /* if for some reason (because of setns() and pid namespace for 
example),
@@ -512,7 +513,7 @@ static bool find_hierarchy_mountpts( struct 
cgroup_meta_data *meta_data, char **
                meta_data->mount_points[mount_point_count++] = mount_point;
 
                mount_point->hierarchy = h;
-               if (is_lxcfs)
+               if (is_lxcfs || is_cgns)
                        mount_point->mount_prefix = strdup("/");
                else
                        mount_point->mount_prefix = strdup(tokens[3]);
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to