Commit 182c515f authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

coredump: elf_fdpic_core_dump: use core_state->dumper list

Kill the nasty rcu_read_lock() + do_each_thread() loop, use the list
encoded in mm->core_state instead, s/GFP_ATOMIC/GFP_KERNEL/.

This patch allows futher cleanups in binfmt_elf_fdpic.c.
Signed-off-by: default avatarOleg Nesterov <>
Acked-by: default avatarRoland McGrath <>
Cc: David Howells <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 83914441
......@@ -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;
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,
if (signr) {
struct core_thread *ct;
struct elf_thread_status *tmp;
if (current->mm == p->mm && current != p) {
if (p->flags & PF_KTHREAD)
tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
if (!tmp) {
goto cleanup;
tmp->thread = p;
list_add(&tmp->list, &thread_list);
for (ct = current->mm->core_state->;
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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment