]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cgroup: grab cgroup_mutex in drop_parsed_module_refcounts()
authorTejun Heo <tj@kernel.org>
Wed, 26 Jun 2013 01:05:21 +0000 (18:05 -0700)
committerTejun Heo <tj@kernel.org>
Wed, 26 Jun 2013 17:40:10 +0000 (10:40 -0700)
This isn't strictly necessary as all subsystems specified in
@subsys_mask are guaranteed to be pinned; however, it does spuriously
trigger lockdep warning.  Let's grab cgroup_mutex around it.

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

index e801ecfa36ef7fc64b2402ce72c3beb385b8558b..2d3a132e881dec769d4db8e7bdf43d903aac8381 100644 (file)
@@ -1325,11 +1325,11 @@ static void drop_parsed_module_refcounts(unsigned long subsys_mask)
        struct cgroup_subsys *ss;
        int i;
 
-       for_each_subsys(ss, i) {
-               if (!(subsys_mask & (1UL << i)))
-                       continue;
-               module_put(cgroup_subsys[i]->module);
-       }
+       mutex_lock(&cgroup_mutex);
+       for_each_subsys(ss, i)
+               if (subsys_mask & (1UL << i))
+                       module_put(cgroup_subsys[i]->module);
+       mutex_unlock(&cgroup_mutex);
 }
 
 static int cgroup_remount(struct super_block *sb, int *flags, char *data)