diff options
author | Yosry Ahmed <[email protected]> | 2022-08-05 14:48:15 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-08-09 09:11:41 -0700 |
commit | f3a2aebdd6fb90e444d595e46de64e822af419da (patch) | |
tree | 6782153a9c2894e19d89e2bab7dd4326976342f6 | |
parent | fa96b24204af42274ec13dfb2f2e6990d7510e55 (diff) |
cgroup: enable cgroup_get_from_file() on cgroup1
cgroup_get_from_file() currently fails with -EBADF if called on cgroup
v1. However, the current implementation works on cgroup v1 as well, so
the restriction is unnecessary.
This enabled cgroup_get_from_fd() to work on cgroup v1, which would be
the only thing stopping bpf cgroup_iter from supporting cgroup v1.
Signed-off-by: Yosry Ahmed <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Hao Luo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
-rw-r--r-- | kernel/cgroup/cgroup.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index ffaccd6373f1..5f4502aa2b3b 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -6132,11 +6132,6 @@ static struct cgroup *cgroup_get_from_file(struct file *f) return ERR_CAST(css); cgrp = css->cgroup; - if (!cgroup_on_dfl(cgrp)) { - cgroup_put(cgrp); - return ERR_PTR(-EBADF); - } - return cgrp; } |