aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 0008dee66514..c9bbcb2a75ae 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -28,6 +28,7 @@ struct css_id;
28extern int cgroup_init_early(void); 28extern int cgroup_init_early(void);
29extern int cgroup_init(void); 29extern int cgroup_init(void);
30extern void cgroup_lock(void); 30extern void cgroup_lock(void);
31extern int cgroup_lock_is_held(void);
31extern bool cgroup_lock_live_group(struct cgroup *cgrp); 32extern bool cgroup_lock_live_group(struct cgroup *cgrp);
32extern void cgroup_unlock(void); 33extern void cgroup_unlock(void);
33extern void cgroup_fork(struct task_struct *p); 34extern void cgroup_fork(struct task_struct *p);
@@ -486,7 +487,9 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
486static inline struct cgroup_subsys_state *task_subsys_state( 487static inline struct cgroup_subsys_state *task_subsys_state(
487 struct task_struct *task, int subsys_id) 488 struct task_struct *task, int subsys_id)
488{ 489{
489 return rcu_dereference(task->cgroups->subsys[subsys_id]); 490 return rcu_dereference_check(task->cgroups->subsys[subsys_id],
491 rcu_read_lock_held() ||
492 cgroup_lock_is_held());
490} 493}
491 494
492static inline struct cgroup* task_cgroup(struct task_struct *task, 495static inline struct cgroup* task_cgroup(struct task_struct *task,