[PATCH] bug fix for 2GB core limit in 2.4

From: Javier Olivares
Date: Tue May 30 2006 - 18:32:59 EST


We were having problems when running programs that used over 2GB of ram
not being able to generate core files over 2GB, these are some very
simple changes that fixed the problem.

The changes have been running on many Debian systems for a couple of
months. Valid core files just over 3GB have been created without any
problem.

---

fs/binfmt_elf.c | 2 +-
fs/exec.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)

04d0e7780b49eeef578ceec8901c71ac356df504
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index b0ad905..6c2f357 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1026,7 +1026,7 @@ static int dump_write(struct file *file,
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
}

-static int dump_seek(struct file *file, off_t off)
+static int dump_seek(struct file *file, loff_t off)
{
if (file->f_op->llseek) {
if (file->f_op->llseek(file, off, 0) != off)
diff --git a/fs/exec.c b/fs/exec.c
index f196e7e..aec92be 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1148,7 +1148,8 @@ int do_coredump(long signr, struct pt_re
goto fail;

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;
inode = file->f_dentry->d_inode;
--
1.3.3


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/