From: Andrew Morton Cc: "Eric W. Biederman" Cc: "Serge E. Hallyn" Cc: Balbir Singh Cc: Dave Hansen Cc: Herbert Poetzl Cc: Kirill Korotaev Cc: Paul Jackson Cc: Paul Menage Cc: Srivatsa Vaddagiri Signed-off-by: Andrew Morton --- kernel/container_debug.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff -puN kernel/container_debug.c~containersv10-simple-debug-info-subsystem-fix kernel/container_debug.c --- a/kernel/container_debug.c~containersv10-simple-debug-info-subsystem-fix +++ a/kernel/container_debug.c @@ -10,10 +10,15 @@ #include #include +#include +#include + +#include static int debug_create(struct container_subsys *ss, struct container *cont) { struct container_subsys_state *css = kzalloc(sizeof(*css), GFP_KERNEL); + if (!css) return -ENOMEM; cont->subsys[debug_subsys_id] = css; @@ -33,6 +38,7 @@ static u64 container_refcount_read(struc static u64 taskcount_read(struct container *cont, struct cftype *cft) { u64 count; + container_lock(); count = container_task_count(cont); container_unlock(); @@ -41,13 +47,14 @@ static u64 taskcount_read(struct contain static u64 current_css_group_read(struct container *cont, struct cftype *cft) { - return (u64) current->containers; + return (u64)current->containers; } static u64 current_css_group_refcount_read(struct container *cont, struct cftype *cft) { u64 count; + rcu_read_lock(); count = atomic_read(¤t->containers->ref.refcount); rcu_read_unlock(); _