Problem with cgroup and lxc in linux 3.3.5
I’m not sure where this cropped up, I leaped many kernel versions, but when one of my LXC based virtual machines suddenly was unable to start machines after a kernel upgrade, the error presented like this:
root@cloud8:\~\# lxc-start -n rattus
lxc-start: Invalid argument - failed to create
'/sys/fs/cgroup//lxc/rattus' directory
lxc-start: failed to spawn 'rattus' lxc-start: No such file or directory
- failed to remove cgroup '/sys/fs/cgroup//lxc/rattus'
Further probing revealed that I could mkdir
a subdirectory (like lxc
in the above example) in my cgroup filesystem, but not a second level
subdirectory (like rattus
) within the first one.
After a bit of adding printk()
calls to the kernel and rebooting, it
turned out that the Network Priority cgroup (CONFIG_NETPRIO_CGROUP)
was the problem. Turning that off fixed my woes.
Further poking about suggests this check in netprio_cgroup.c is probably to blame, but I don’t understand what prioidx is, so I leave it here.
if (cgrp->parent && cgrp_netprio_state(cgrp->parent)->prioidx) {
kfree(cs);
return ERR_PTR(-EINVAL);
}