diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2014-09-16 00:17:00 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-09-22 12:22:07 +0400 |
commit | 5debac7e79c194a34a2be9992c2819584dc42b4c (patch) | |
tree | 35193a6374e6eed4a0257292df44144b052ad17d | |
parent | 5050c3bbfa04cd3599375382efa73f319d6da0a2 (diff) |
cg: proc_parse -- Don't compare cgroup paths
When we compare sets in cg_set_compare() we presume that controller
names are properly sorted but because of use of strcmp(cc->path, path)
it's not true. In particular in case if there are two same sets which
differ in paths only
(00.126812) cg: `- New css ID 2
(00.127051) cg: `- [memory] -> [/vz-1]
(00.127079) cg: `- [name=systemd] -> [/vz-1]
(00.127108) cg: `- [net_cls] -> [/vz-1]
(00.239829) cg: `- New css ID 3
(00.240067) cg: `- [memory] -> [/vz-1]
(00.240096) cg: `- [net_cls] -> [/vz-1]
(00.240154) cg: `- [name=systemd] -> [/vz-1/system.slice/dbus.service]
we currently refuse to dump such configuretion. Thus remove
path comparision from the first place.
CC: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | proc_parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/proc_parse.c b/proc_parse.c index 88c8ddc0d..50a927400 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -1639,7 +1639,7 @@ int parse_task_cgroup(int pid, struct list_head *retl, unsigned int *n) } list_for_each_entry(cc, retl, l) - if (strcmp(cc->name, name) >= 0 && strcmp(cc->path, path) >= 0) + if (strcmp(cc->name, name) >= 0) break; list_add_tail(&ncc->l, &cc->l); |