Skip to content
  • Li Zefan's avatar
    cpuset: fix a regression in validating config change · 1c09b195
    Li Zefan authored
    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 88fa523b
    
    
    ("cpuset: allow to move tasks to empty cpusets").
    
    tj: Dropped temp bool variables and nestes the conditionals directly.
    
    Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    1c09b195