Commit f3a2aebd authored by Yosry Ahmed's avatar Yosry Ahmed Committed by Alexei Starovoitov

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: default avatarYosry Ahmed <yosryahmed@google.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarHao Luo <haoluo@google.com>
Link: https://lore.kernel.org/r/20220805214821.1058337-3-haoluo@google.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent fa96b242
...@@ -6132,11 +6132,6 @@ static struct cgroup *cgroup_get_from_file(struct file *f) ...@@ -6132,11 +6132,6 @@ static struct cgroup *cgroup_get_from_file(struct file *f)
return ERR_CAST(css); return ERR_CAST(css);
cgrp = css->cgroup; cgrp = css->cgroup;
if (!cgroup_on_dfl(cgrp)) {
cgroup_put(cgrp);
return ERR_PTR(-EBADF);
}
return cgrp; return cgrp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment