Commit b99b76b0 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent aadc309a
......@@ -1729,7 +1729,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);
......
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