Skip to content

Commit 03db771

Browse files
committed
Revert "cgroup: enable cgroup_get_from_file() on cgroup1"
This reverts commit f3a2aeb. The commit enabled looking up v1 cgroups via cgroup_get_from_file(). However, there are multiple users, including CLONE_INTO_CGROUP, which have been assuming that it would only look up v2 cgroups. Returning v1 cgroups breaks them. Let's revert the commit and retry later with a separate lookup interface which allows both v1 and v2. Signed-off-by: Tejun Heo <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Cc: Yosry Ahmed <[email protected]>
1 parent 46307fd commit 03db771

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/cgroup/cgroup.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6234,6 +6234,11 @@ static struct cgroup *cgroup_get_from_file(struct file *f)
62346234
return ERR_CAST(css);
62356235

62366236
cgrp = css->cgroup;
6237+
if (!cgroup_on_dfl(cgrp)) {
6238+
cgroup_put(cgrp);
6239+
return ERR_PTR(-EBADF);
6240+
}
6241+
62376242
return cgrp;
62386243
}
62396244

0 commit comments

Comments
 (0)