If add into the cgroup.subtree_control file with a subsystem name which is beyond the scope of the ones in the parent's cgroup.subtree_control file, the response is ’no such file or directory', which is confusing since the cgroup.subtree_control file is present, return EINVAL in this case. Signed-off-by: Li Wang <liwang@xxxxxxxxxx> --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 484adb375b15..77c1324ce0c1 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -3391,7 +3391,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of, } if (!(cgroup_control(cgrp) & (1 << ssid))) { - ret = -ENOENT; + ret = -EINVAL; goto out_unlock; } } else if (disable & (1 << ssid)) { -- 2.34.1