]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Enable coredumps > 2GB
authorAndrew Morton <akpm@osdl.org>
Wed, 18 Feb 2004 12:49:52 +0000 (04:49 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 18 Feb 2004 12:49:52 +0000 (04:49 -0800)
From: Andi Kleen <ak@muc.de>

Some x86-64 users were complaining that coredumps >2GB don't work.

This will enable large coredump for everybody.  Apparently the 32bit
gdb/binutils cannot handle them, but I hear the binutils people are working
on fixing that.  I doubt it will harm people - unreadable coredumps are not
worse than no coredump and it won't make any difference in space usage if
you get a 1.99GB or a 2.5GB coredump.  So just enable it unconditionally.
If it should be really a problem for 32bit the rlimit defaults in
resource.h could be changed.

For file systems that don't support O_LARGEFILE you should just get an
truncated coredumps for big address spaces.

fs/exec.c

index 73c5213a629319b9fd112f5833bb682c943ece48..4b50264376f82be21bb7afdbbdac3e482ec42616 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1386,7 +1386,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
                goto fail_unlock;
 
        format_corename(corename, core_pattern, signr);
-       file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
+       file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE, 0600);
        if (IS_ERR(file))
                goto fail_unlock;
        inode = file->f_dentry->d_inode;