]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
coredump: factor out the setting of PF_DUMPCORE
authorOleg Nesterov <oleg@redhat.com>
Tue, 26 Mar 2013 23:25:54 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 2 Apr 2013 07:29:50 +0000 (18:29 +1100)
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>
arch/x86/ia32/ia32_aout.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/coredump.c

index 14fb6f9a73634213ad2684b8945e41d4d6ba0222..0f9a4728a467861e60f6a3e4ad3fe378a0afccb3 100644 (file)
@@ -162,7 +162,6 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
        fs = get_fs();
        set_fs(KERNEL_DS);
        has_dumped = 1;
-       current->flags |= PF_DUMPCORE;
        strncpy(dump.u_comm, current->comm, sizeof(current->comm));
        dump.u_ar0 = offsetof(struct user32, regs);
        dump.signal = signr;
index b370338190704d8036fc53394293dc073ee16472..14b7ea3c8f5e3d9d463e5a41aa8a7b30e2ada6fa 100644 (file)
@@ -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;
index 8afbb009b2e206371d17703abca36b48507712c8..ced3dcfdac8c9c68181698adf5d895b2e28dc888 100644 (file)
@@ -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);
 
index 9c13e023e2b72368004bad13033a7709ee5c62a6..c1cc06aed601a791a6d46ca5d0ffcae18cecec06 100644 (file)
@@ -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.
index 94c4876a6a4cde9b071927e38f2e8ab98cbdf9cb..0bf4f44f1faa49a3571b14178c3096c919c599fd 100644 (file)
@@ -299,6 +299,7 @@ static int zap_threads(struct task_struct *tsk, struct mm_struct *mm,
        if (unlikely(nr < 0))
                return nr;
 
+       tsk->flags = PF_DUMPCORE;
        if (atomic_read(&mm->mm_users) == nr + 1)
                goto done;
        /*