Skip to content

Commit

Permalink
cpuset: fix the return value of cpuset_write_u64()
Browse files Browse the repository at this point in the history
Writing to this file always returns -ENODEV:

  # echo 1 > cpuset.memory_pressure_enabled
  -bash: echo: write error: No such device

Signed-off-by: Li Zefan <[email protected]>
Cc: <[email protected]> # 3.9+
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
lizf-os authored and htejun committed Aug 13, 2013
1 parent da0a12c commit a903f08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,11 +1608,13 @@ static int cpuset_write_u64(struct cgroup *cgrp, struct cftype *cft, u64 val)
{
struct cpuset *cs = cgroup_cs(cgrp);
cpuset_filetype_t type = cft->private;
int retval = -ENODEV;
int retval = 0;

mutex_lock(&cpuset_mutex);
if (!is_cpuset_online(cs))
if (!is_cpuset_online(cs)) {
retval = -ENODEV;
goto out_unlock;
}

switch (type) {
case FILE_CPU_EXCLUSIVE:
Expand Down

0 comments on commit a903f08

Please sign in to comment.