From 95b387a4e9773b98248f9d6594692cd07ecad4b6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 18 Feb 2004 04:49:52 -0800 Subject: [PATCH] [PATCH] Enable coredumps > 2GB From: Andi Kleen 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index 73c5213a62931..4b50264376f82 100644 --- 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; -- 2.53.0