Skip to content

Commit

Permalink
cgroup: enable cgroup_get_from_file() on cgroup1
Browse files Browse the repository at this point in the history
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 <yosryahmed@google.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hao Luo <haoluo@google.com>
Link: https://lore.kernel.org/r/20220805214821.1058337-3-haoluo@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
yosrym93 authored and Alexei Starovoitov committed Aug 9, 2022
1 parent fa96b24 commit f3a2aeb
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f3a2aeb

Please sign in to comment.