Commit 992b78d7 by Christian Brauner

Merge pull request #856 from hallyn/2016-02-26/cgfs.cgns.2

cgfs: ignore mount prefix in mountinfo if cgroup namespaces are suppo…
parents 5d55659d fcca16bc
...@@ -418,6 +418,7 @@ static bool find_hierarchy_mountpts( struct cgroup_meta_data *meta_data, char ** ...@@ -418,6 +418,7 @@ static bool find_hierarchy_mountpts( struct cgroup_meta_data *meta_data, char **
size_t mount_point_capacity = 0; size_t mount_point_capacity = 0;
size_t token_capacity = 0; size_t token_capacity = 0;
int r; int r;
bool is_cgns = cgns_supported();
proc_self_mountinfo = fopen_cloexec("/proc/self/mountinfo", "r"); proc_self_mountinfo = fopen_cloexec("/proc/self/mountinfo", "r");
/* if for some reason (because of setns() and pid namespace for example), /* 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 ** ...@@ -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; meta_data->mount_points[mount_point_count++] = mount_point;
mount_point->hierarchy = h; mount_point->hierarchy = h;
if (is_lxcfs) if (is_lxcfs || is_cgns)
mount_point->mount_prefix = strdup("/"); mount_point->mount_prefix = strdup("/");
else else
mount_point->mount_prefix = strdup(tokens[3]); mount_point->mount_prefix = strdup(tokens[3]);
......
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