Skip to content

Commit 87eba5b

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Remove the unnecessary css_get/put() in cpuset_partition_write()
The css_get/put() calls in cpuset_partition_write() are unnecessary as an active reference of the kernfs node will be taken which will prevent its removal and guarantee the existence of the css. Only the online check is needed. Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 150e298 commit 87eba5b

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

kernel/cgroup/cpuset.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,14 +3358,12 @@ static ssize_t cpuset_partition_write(struct kernfs_open_file *of, char *buf,
33583358
else
33593359
return -EINVAL;
33603360

3361-
css_get(&cs->css);
33623361
cpus_read_lock();
33633362
mutex_lock(&cpuset_mutex);
33643363
if (is_cpuset_online(cs))
33653364
retval = update_prstate(cs, val);
33663365
mutex_unlock(&cpuset_mutex);
33673366
cpus_read_unlock();
3368-
css_put(&cs->css);
33693367
return retval ?: nbytes;
33703368
}
33713369

0 commit comments

Comments
 (0)