From mboxrd@z Thu Jan 1 00:00:00 1970 From: menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org Subject: [PATCH 02/29] task containersv11 basic task container framework fix Date: Tue, 11 Sep 2007 12:52:41 -0700 Message-ID: <20070911200144.949173000@menage.corp.google.com> References: <20070911195239.997111000@menage.corp.google.com> Return-path: Content-Disposition: inline; filename=task-containersv11-basic-task-container-framework-fix.patch List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org Cc: Andrew Morton List-Id: containers.vger.kernel.org From: "Paul Menage" On 7/28/07, Andrew Morton wrote: > > [] proc_cpuset_show+0x5e/0xb9 > > [] seq_read+0xef/0x266 > > [] vfs_read+0x8e/0x117 > > [] sys_read+0x3d/0x61 > > [] sysenter_past_esp+0x5f/0x99 > > ======================= > > INFO: lockdep is turned off. > > Code: 00 89 d8 83 c4 0c 5b 5e 5f 5d c3 55 89 e5 57 56 53 83 ec 08 89 > > 45 f0 89 55 ec 89 d3 01 cb 8d 43 ff c6 43 ff 00 8b 55 f0 8b 72 1c <8b> > > 56 3c 29 d0 3b 45 ec 72 45 89 d1 c1 e9 02 8b 76 40 89 c7 f3 > > EIP: [] cgroup_path+0x20/0x7b SS:ESP 0068:c5ccff00 > Oops, this is a case of trying to read /proc/self/cpuset when cpusets are completely unmounted. It works fine when cpusets is mounted as part of any hierarchy, or part of an active but unmounted hierarchy. Attached patch fixes it, and should be rolled in to the first patch of the series. (basic framework patch). Signed-off-by: Andrew Morton --- kernel/cgroup.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff -puN kernel/cgroup.c~task-cgroupsv11-basic-task-cgroup-framework-fix kernel/cgroup.c --- a/kernel/cgroup.c~task-cgroupsv11-basic-task-cgroup-framework-fix +++ a/kernel/cgroup.c @@ -683,6 +683,15 @@ int cgroup_path(const struct containe { char *start; + if (cont == dummytop) { + /* + * Inactive subsystems have no dentry for their root + * cgroup + */ + strcpy(buf, "/"); + return 0; + } + start = buf + buflen; *--start = '\0'; _ --