cgroup: Improve cftype add/rm error handling
authorTejun Heo <tj@kernel.org>
Tue, 6 Sep 2022 19:38:42 +0000 (09:38 -1000)
committerTejun Heo <tj@kernel.org>
Tue, 6 Sep 2022 19:38:42 +0000 (09:38 -1000)
commit0083d27b21dd2a598df8275b98f89ced532e2e53
treedb78020e98048585f96670af1da28bf2d0b3e855
parenta8c52eba880a6e8c07fc2130604f8e386b90b763
cgroup: Improve cftype add/rm error handling

Let's track whether a cftype is currently added or not using a new flag
__CFTYPE_ADDED so that duplicate operations can be failed safely and
consistently allow using empty cftypes.

Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup-defs.h
kernel/cgroup/cgroup.c