Commit 079148b919d0c58b796f9ae98bdb53028dbcd5e7

Authored by Oleg Nesterov
Committed by Linus Torvalds
1 parent 528f827ee0

coredump: factor out the setting of PF_DUMPCORE

Cleanup.  Every linux_binfmt->core_dump() sets PF_DUMPCORE, move this into
zap_threads() called by do_coredump().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Neil Horman <nhorman@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 5 changed files with 2 additions and 6 deletions Side-by-side Diff

arch/x86/ia32/ia32_aout.c
... ... @@ -162,7 +162,6 @@
162 162 fs = get_fs();
163 163 set_fs(KERNEL_DS);
164 164 has_dumped = 1;
165   - current->flags |= PF_DUMPCORE;
166 165 strncpy(dump.u_comm, current->comm, sizeof(current->comm));
167 166 dump.u_ar0 = offsetof(struct user32, regs);
168 167 dump.signal = signr;
... ... @@ -62,7 +62,6 @@
62 62 fs = get_fs();
63 63 set_fs(KERNEL_DS);
64 64 has_dumped = 1;
65   - current->flags |= PF_DUMPCORE;
66 65 strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
67 66 dump.u_ar0 = offsetof(struct user, regs);
68 67 dump.signal = cprm->siginfo->si_signo;
... ... @@ -2092,8 +2092,7 @@
2092 2092 goto cleanup;
2093 2093  
2094 2094 has_dumped = 1;
2095   - current->flags |= PF_DUMPCORE;
2096   -
  2095 +
2097 2096 fs = get_fs();
2098 2097 set_fs(KERNEL_DS);
2099 2098  
fs/binfmt_elf_fdpic.c
... ... @@ -1687,8 +1687,6 @@
1687 1687 fill_elf_fdpic_header(elf, e_phnum);
1688 1688  
1689 1689 has_dumped = 1;
1690   - current->flags |= PF_DUMPCORE;
1691   -
1692 1690 /*
1693 1691 * Set up the notes in similar form to SVR4 core dumps made
1694 1692 * with info from their /proc.
... ... @@ -299,6 +299,7 @@
299 299 if (unlikely(nr < 0))
300 300 return nr;
301 301  
  302 + tsk->flags = PF_DUMPCORE;
302 303 if (atomic_read(&mm->mm_users) == nr + 1)
303 304 goto done;
304 305 /*