diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2008-10-18 23:28:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:39 -0400 |
commit | 6409324b385f3f63a03645b4422e3be67348d922 (patch) | |
tree | 97e44f11995236086c7ee712640b2913c94b7000 /fs | |
parent | b747c8c102cc0677a7a8056a093f58d7c9b500e7 (diff) |
coredump: format_corename: don't append .%pid if multi-threaded
If the coredumping is multi-threaded, format_corename() appends .%pid to
the corename. This was needed before the proper multi-thread core dump
support, now all the threads in the mm go into a single unified core file.
Remove this special case, it is not even documented and we have "%p"
and core_uses_pid.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Roland McGrath <roland@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: La Monte Yarroll <piggy@laurelnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1386,7 +1386,7 @@ EXPORT_SYMBOL(set_binfmt); | |||
1386 | * name into corename, which must have space for at least | 1386 | * name into corename, which must have space for at least |
1387 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. | 1387 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. |
1388 | */ | 1388 | */ |
1389 | static int format_corename(char *corename, int nr_threads, long signr) | 1389 | static int format_corename(char *corename, long signr) |
1390 | { | 1390 | { |
1391 | const char *pat_ptr = core_pattern; | 1391 | const char *pat_ptr = core_pattern; |
1392 | int ispipe = (*pat_ptr == '|'); | 1392 | int ispipe = (*pat_ptr == '|'); |
@@ -1493,8 +1493,7 @@ static int format_corename(char *corename, int nr_threads, long signr) | |||
1493 | * If core_pattern does not include a %p (as is the default) | 1493 | * If core_pattern does not include a %p (as is the default) |
1494 | * and core_uses_pid is set, then .%pid will be appended to | 1494 | * and core_uses_pid is set, then .%pid will be appended to |
1495 | * the filename. Do not do this for piped commands. */ | 1495 | * the filename. Do not do this for piped commands. */ |
1496 | if (!ispipe && !pid_in_pattern | 1496 | if (!ispipe && !pid_in_pattern && core_uses_pid) { |
1497 | && (core_uses_pid || nr_threads)) { | ||
1498 | rc = snprintf(out_ptr, out_end - out_ptr, | 1497 | rc = snprintf(out_ptr, out_end - out_ptr, |
1499 | ".%d", task_tgid_vnr(current)); | 1498 | ".%d", task_tgid_vnr(current)); |
1500 | if (rc > out_end - out_ptr) | 1499 | if (rc > out_end - out_ptr) |
@@ -1757,7 +1756,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
1757 | * uses lock_kernel() | 1756 | * uses lock_kernel() |
1758 | */ | 1757 | */ |
1759 | lock_kernel(); | 1758 | lock_kernel(); |
1760 | ispipe = format_corename(corename, retval, signr); | 1759 | ispipe = format_corename(corename, signr); |
1761 | unlock_kernel(); | 1760 | unlock_kernel(); |
1762 | /* | 1761 | /* |
1763 | * Don't bother to check the RLIMIT_CORE value if core_pattern points | 1762 | * Don't bother to check the RLIMIT_CORE value if core_pattern points |