From f7deec40e119e20f0cef49d5d15337505554c4ec Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 25 Jul 2008 01:47:45 -0700 Subject: [PATCH] --- yaml --- r: 105943 b: refs/heads/master c: 182c515fd2a942623aed4e4e0e0b37fe96571b05 h: refs/heads/master i: 105941: f63b060f455d99c3b046881803497f39c62fd3b0 105939: c2ea9cc879a968f1fd7979d2562e3e44fb1de445 105935: 35f0841ea03a885e4673376d05367e24b4a731aa v: v3 --- [refs] | 2 +- trunk/fs/binfmt_elf_fdpic.c | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index df74a455e412..00b955eb53b1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 83914441f94c6f2cd468ca97365f6c34f418706e +refs/heads/master: 182c515fd2a942623aed4e4e0e0b37fe96571b05 diff --git a/trunk/fs/binfmt_elf_fdpic.c b/trunk/fs/binfmt_elf_fdpic.c index 71bcc4b4d088..1b59b1edf26d 100644 --- a/trunk/fs/binfmt_elf_fdpic.c +++ b/trunk/fs/binfmt_elf_fdpic.c @@ -1573,7 +1573,6 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, struct memelfnote *notes = NULL; struct elf_prstatus *prstatus = NULL; /* NT_PRSTATUS */ struct elf_prpsinfo *psinfo = NULL; /* NT_PRPSINFO */ - struct task_struct *g, *p; LIST_HEAD(thread_list); struct list_head *t; elf_fpregset_t *fpu = NULL; @@ -1622,23 +1621,19 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, #endif if (signr) { + struct core_thread *ct; struct elf_thread_status *tmp; - rcu_read_lock(); - do_each_thread(g,p) - if (current->mm == p->mm && current != p) { - if (p->flags & PF_KTHREAD) - continue; - - tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC); - if (!tmp) { - rcu_read_unlock(); - goto cleanup; - } - tmp->thread = p; - list_add(&tmp->list, &thread_list); - } - while_each_thread(g,p); - rcu_read_unlock(); + + for (ct = current->mm->core_state->dumper.next; + ct; ct = ct->next) { + tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + goto cleanup; + + tmp->thread = ct->task; + list_add(&tmp->list, &thread_list); + } + list_for_each(t, &thread_list) { struct elf_thread_status *tmp; int sz;