diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-03-02 15:25:36 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-03-07 14:26:48 +1100 |
commit | 52f687bdfc1ee509cf03a552e710010c2b36917a (patch) | |
tree | 0c865b61c4dc6e9f93d9ea64763e1bc6e5fc777f /fs | |
parent | 0f261a76da464093e5f5187e53dd25332419745b (diff) |
coredump: factor out the setting of PF_DUMPCORE
Cleanup and preparation. 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>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: Neil Horman <nhorman@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_aout.c | 1 | ||||
-rw-r--r-- | fs/binfmt_elf.c | 3 | ||||
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 2 | ||||
-rw-r--r-- | fs/coredump.c | 1 |
4 files changed, 2 insertions, 5 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index b37033819070..14b7ea3c8f5e 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c @@ -62,7 +62,6 @@ static int aout_core_dump(struct coredump_params *cprm) fs = get_fs(); set_fs(KERNEL_DS); has_dumped = 1; - current->flags |= PF_DUMPCORE; strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm)); dump.u_ar0 = offsetof(struct user, regs); dump.signal = cprm->siginfo->si_signo; diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 8afbb009b2e2..ced3dcfdac8c 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -2107,8 +2107,7 @@ static int elf_core_dump(struct coredump_params *cprm) goto cleanup; has_dumped = 1; - current->flags |= PF_DUMPCORE; - + fs = get_fs(); set_fs(KERNEL_DS); diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 9c13e023e2b7..c1cc06aed601 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1687,8 +1687,6 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) fill_elf_fdpic_header(elf, e_phnum); has_dumped = 1; - current->flags |= PF_DUMPCORE; - /* * Set up the notes in similar form to SVR4 core dumps made * with info from their /proc. diff --git a/fs/coredump.c b/fs/coredump.c index 3651a6d920f8..b0168c798923 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -290,6 +290,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm, if (!signal_group_exit(tsk->signal)) { mm->core_state = core_state; nr = zap_process(tsk, exit_code); + tsk->flags = PF_DUMPCORE; tsk->signal->group_exit_task = tsk; /* ignore all signals except SIGKILL, see prepare_signal() */ tsk->signal->flags = SIGNAL_GROUP_COREDUMP; |