From: Ivana Hutarova Varekova Date: Fri, 24 Sep 2010 05:38:12 +0000 (+0530) Subject: There is a problem in cgroup_init function X-Git-Tag: v0.37.1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7bc3d94afbec90ce5c7c07dff7070ccdc546032;p=thirdparty%2Flibcgroup.git There is a problem in cgroup_init function Now if the function strtok_r get at first the controller which precedes some other controllers on the mount-point option list, then it removes all next controllers from the list and they are omitted. The test which is done by strtok_r is redundant (there is already hasmntopt test), so the patch is removing it at all. E.G. use commands: $ mount -t cgroup -o cpu,memory,net_cls lab1 /cgroup/lab1 $ mount -t cgroup -o remount,cpuset,cpu,memory,net_cls lab1 /cgroup/lab1 $ lssubsys -ma Signed-off-by: Ivana Hutarova Varekova Signed-off-by: Balbir Singh --- diff --git a/src/api.c b/src/api.c index 1e6e3c3c..6cd0185b 100644 --- a/src/api.c +++ b/src/api.c @@ -733,12 +733,7 @@ int cgroup_init(void) if (!mntopt) continue; - mntopt = strtok_r(mntopt, ",", &strtok_buffer); - - if (strcmp(mntopt, controllers[i])) - continue; - - cgroup_dbg("matched %s:%s\n", mntopt, controllers[i]); + cgroup_dbg("found %s in %s\n", controllers[i], ent->mnt_opts); /* do not have duplicates in mount table */ duplicate = 0;