]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Allow creation of a v2 cgroup with no controllers 102/head
authorTom Hromatka <tom.hromatka@oracle.com>
Thu, 17 Feb 2022 21:17:15 +0000 (14:17 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 23 Feb 2022 18:40:13 +0000 (11:40 -0700)
commit3625e85ff492463470a90cfcc61b80cc05165d46
tree1ac7ec714a885671ef338a93d8ab4fef2027845b
parentfb7f397e5e12c95a6ea21f4c19c539548a1ad137
api.c: Allow creation of a v2 cgroup with no controllers

Commit 498530a1d744 ("cgcreate, tools: Allow cgroup creation with
no controllers attached") attempted to add support to allow the
creation of a cgroup v2 cgroup with no controllers attached.  This
patch did create the requested cgroup, but it still required there
to be at least one valid controller _available_ to attach to.

Rework the aforementioned logic so that the cgroup can be created
if there's a valid cgroup v2 mount - even if there are no v2
controllers available.

Fixes: 498530a1d744 ("cgcreate, tools: Allow cgroup creation with no controllers attached")
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/api.c