cgroup: Homogenize cgroup_get_from_id() return value
authorMichal Koutný <mkoutny@suse.com>
Fri, 26 Aug 2022 16:52:37 +0000 (18:52 +0200)
committerTejun Heo <tj@kernel.org>
Fri, 26 Aug 2022 20:57:41 +0000 (10:57 -1000)
commitfa7e439cf90ba23ea473d0b7d85efd02ae6ccf94
tree9361bef45e46f7ba7fd29ea16ca23405cfbfce97
parent4534dee941056a4ab9dca4a9e2edff28692800b2
cgroup: Homogenize cgroup_get_from_id() return value

Cgroup id is user provided datum hence extend its return domain to
include possible error reason (similar to cgroup_get_from_fd()).

This change also fixes commit d4ccaf58a847 ("bpf: Introduce cgroup
iter") that would use NULL instead of proper error handling in
d4ccaf58a847 ("bpf: Introduce cgroup iter").

Additionally, neither of: fc_appid_store, bpf_iter_attach_cgroup,
mem_cgroup_get_from_ino (callers of cgroup_get_from_fd) is built without
CONFIG_CGROUPS (depends via CONFIG_BLK_CGROUP, direct, transitive
CONFIG_MEMCG respectively) transitive, so drop the singular definition
not needed with !CONFIG_CGROUPS.

Fixes: d4ccaf58a847 ("bpf: Introduce cgroup iter")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
block/blk-cgroup-fc-appid.c
include/linux/cgroup.h
kernel/cgroup/cgroup.c
mm/memcontrol.c