]> git.baikalelectronics.ru Git - kernel.git/commit
cpuset: fix a regression in validating config change
authorLi Zefan <lizefan@huawei.com>
Wed, 21 Aug 2013 02:22:28 +0000 (10:22 +0800)
committerTejun Heo <tj@kernel.org>
Wed, 21 Aug 2013 12:40:27 +0000 (08:40 -0400)
commitf8e1c96ace16c656aab4521fa78b2814b960d075
treef5a489a926304b07a982ea61a7ea8ebeaf253653
parent24bf6d008bbf4e79e3adcba0a0961cbbc37d13a4
cpuset: fix a regression in validating config change

It's not allowed to clear masks of a cpuset if there're tasks in it,
but it's broken:

  # mkdir /cgroup/sub
  # echo 0 > /cgroup/sub/cpuset.cpus
  # echo 0 > /cgroup/sub/cpuset.mems
  # echo $$ > /cgroup/sub/tasks
  # echo > /cgroup/sub/cpuset.cpus
  (should fail)

This bug was introduced by commit 8bfbec0db6fae0edfa208b14698fa1ab0f7d097a
("cpuset: allow to move tasks to empty cpusets").

tj: Dropped temp bool variables and nestes the conditionals directly.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cpuset.c