public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: lizefan@huawei.com, LKML <linux-kernel@vger.kernel.org>,
	cgroups@vger.kernel.org, trinity@vger.kernel.org
Subject: [PATCH cgroup/for-3.11] cgroup: grab cgroup_mutex in drop_parsed_module_refcounts()
Date: Tue, 25 Jun 2013 18:05:21 -0700	[thread overview]
Message-ID: <20130626010521.GE30407@mtj.dyndns.org> (raw)
In-Reply-To: <20130626010454.GD30407@mtj.dyndns.org>

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>
---
 kernel/cgroup.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1325,11 +1325,11 @@ static void drop_parsed_module_refcounts
 	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)

  reply	other threads:[~2013-06-26  1:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 17:20 cgroup: kernel BUG at kernel/cgroup.c:1038! Sasha Levin
     [not found] ` <51C9D17B.5090208-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-06-26  1:04   ` [PATCH cgroup/for-3.11] cgroup: fix cgroupfs_root early destruction path Tejun Heo
2013-06-26  1:05     ` Tejun Heo [this message]
2013-06-26  9:12       ` [PATCH cgroup/for-3.11] cgroup: grab cgroup_mutex in drop_parsed_module_refcounts() Li Zefan
     [not found]       ` <20130626010521.GE30407-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-06-26 17:50         ` Tejun Heo
     [not found]           ` <20130626175008.GF4405-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-06-26 18:51             ` Sasha Levin
     [not found]     ` <20130626010454.GD30407-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-06-26  9:14       ` [PATCH cgroup/for-3.11] cgroup: fix cgroupfs_root early destruction path Li Zefan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130626010521.GE30407@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=sasha.levin@oracle.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox