All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroups: use task_lock() for access tsk->cgroups safe in cgroup_clone()
@ 2008-11-21  8:49 Lai Jiangshan
       [not found] ` <49267633.8040607-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
  2008-11-21 19:18 ` Paul Menage
  0 siblings, 2 replies; 4+ messages in thread
From: Lai Jiangshan @ 2008-11-21  8:49 UTC (permalink / raw)
  To: Andrew Morton, Paul Menage, Linux Kernel Mailing List,
	Linux Containers


use task_lock() protect tsk->cgroups and get_css_set(tsk->cgroups)


Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..ddc10ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2933,6 +2943,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 		mutex_unlock(&cgroup_mutex);
 		return 0;
 	}
+	task_lock(tsk);
 	cg = tsk->cgroups;
 	parent = task_cgroup(tsk, subsys->subsys_id);
 
@@ -2941,6 +2952,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 
 	/* Keep the cgroup alive */
 	get_css_set(cg);
+	task_unlock(tsk);
 	mutex_unlock(&cgroup_mutex);
 
 	/* Now do the VFS work to create a cgroup */


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] cgroups: use task_lock() for access tsk->cgroups safe in cgroup_clone()
@ 2008-11-21  8:49 Lai Jiangshan
  0 siblings, 0 replies; 4+ messages in thread
From: Lai Jiangshan @ 2008-11-21  8:49 UTC (permalink / raw)
  To: Andrew Morton, Paul Menage, Linux Kernel Mailing List,
	Linux Containers


use task_lock() protect tsk->cgroups and get_css_set(tsk->cgroups)


Signed-off-by: Lai Jiangshan <laijs-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..ddc10ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2933,6 +2943,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 		mutex_unlock(&cgroup_mutex);
 		return 0;
 	}
+	task_lock(tsk);
 	cg = tsk->cgroups;
 	parent = task_cgroup(tsk, subsys->subsys_id);
 
@@ -2941,6 +2952,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 
 	/* Keep the cgroup alive */
 	get_css_set(cg);
+	task_unlock(tsk);
 	mutex_unlock(&cgroup_mutex);
 
 	/* Now do the VFS work to create a cgroup */

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

end of thread, other threads:[~2008-11-21 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21  8:49 [PATCH] cgroups: use task_lock() for access tsk->cgroups safe in cgroup_clone() Lai Jiangshan
     [not found] ` <49267633.8040607-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-11-21 19:18   ` Paul Menage
2008-11-21 19:18 ` Paul Menage
  -- strict thread matches above, loose matches on Subject: below --
2008-11-21  8:49 Lai Jiangshan

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.