summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-05-13 12:11:00 -0400
committerTejun Heo <tj@kernel.org>2014-05-13 12:11:00 -0400
commit46cfeb043b04f5878154bea36714709d46028495 (patch)
tree95194af924a2b66626ae2bc9951231d77cb06b10 /kernel/cgroup.c
parent7d331fa985d3a39d5b8cb60caf016d3e53e57c91 (diff)
downloadlinux-46cfeb043b04f5878154bea36714709d46028495.tar.bz2
cgroup: use release_agent_path_lock in cgroup_release_agent_show()
release_path is now protected by release_agent_path_lock to allow accessing it without grabbing cgroup_mutex; however, cgroup_release_agent_show() was still grabbing cgroup_mutex. Let's convert it to release_agent_path_lock so that we don't have to worry about this one for the planned locking updates. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3251cc9070fa..7633703e9baf 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2373,11 +2373,10 @@ static int cgroup_release_agent_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
- if (!cgroup_lock_live_group(cgrp))
- return -ENODEV;
+ spin_lock(&release_agent_path_lock);
seq_puts(seq, cgrp->root->release_agent_path);
+ spin_unlock(&release_agent_path_lock);
seq_putc(seq, '\n');
- mutex_unlock(&cgroup_mutex);
return 0;
}