All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: Fixes the un-paired cgroup lock problem
@ 2009-11-04  1:40 Liu Aleaxander
  2009-11-04  5:11 ` Li Zefan
  0 siblings, 1 reply; 8+ messages in thread
From: Liu Aleaxander @ 2009-11-04  1:40 UTC (permalink / raw)
  To: Paul Menage, Li Zefan, linux-kernel, containers

From: Liu Aleaxander <Aleaxander@gmail.com>
Date: Wed, 4 Nov 2009 09:27:06 +0800
Subject: [PATCH] Fixes the un-paired cgroup lock problem

In cgroup_lock_live_group, it locks the cgroup by mutex_lock, while in the
cgroup_tasks_write, it unlock it by cgroup_unlock. Even though they are
equal, but I do think we should make it pair.

BTW, should we replace others with cgroup_lock and cgroup_unlock?
Since we already have a wrapper one and it's meaningful.

Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
---
 kernel/cgroup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 0249f4b..ee2274e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1660,9 +1660,9 @@ static int cgroup_tasks_write(struct cgroup
*cgrp, struct cftype *cft, u64 pid)
  */
 bool cgroup_lock_live_group(struct cgroup *cgrp)
 {
-	mutex_lock(&cgroup_mutex);
+	cgroup_lock();
 	if (cgroup_is_removed(cgrp)) {
-		mutex_unlock(&cgroup_mutex);
+		cgroup_unlock();
 		return false;
 	}
 	return true;
-- 
1.6.2.5

-- 
regards
Liu Aleaxander

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-06 15:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04  1:40 [PATCH] cgroup: Fixes the un-paired cgroup lock problem Liu Aleaxander
2009-11-04  5:11 ` Li Zefan
2009-11-04 14:26   ` Bill Davidsen
2009-11-05  8:02     ` Li Zefan
     [not found]       ` <4AF28695.7070806-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-11-06  0:14         ` Bill Davidsen
2009-11-06  1:05           ` Matt Helsley
2009-11-06 15:17             ` Bill Davidsen
2009-11-06 15:17       ` Bill Davidsen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.