Skip to content

Commit

Permalink
Revert "cgroup: enable cgroup_get_from_file() on cgroup1"
Browse files Browse the repository at this point in the history
This reverts commit f3a2aeb.

Some callers of this function depended on the fact that it only supports
cgroup v2. Revert it now, and introduce a new function in a later patch
that supports both cgroup v1 and v2, for callers that need to support
both.

Reported-by: Christian A. Ehrhardt <lk@c--e.de>
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
  • Loading branch information
yosrym93 authored and intel-lab-lkp committed Oct 11, 2022
1 parent 2e30960 commit 4572d1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/cgroup/cgroup.c
Expand Up @@ -6167,6 +6167,11 @@ 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 4572d1d

Please sign in to comment.