diff options
author | Petr Vandrovec <petr@vandrovec.name> | 2006-10-12 22:13:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-13 11:13:34 -0400 |
commit | 7f14daa19ea36b200d237ad3ac5826ae25360461 (patch) | |
tree | a123fefbb13871de2bc30fff49a4418b48a38732 /fs | |
parent | 12e36b2f41b6cbc67386fcb9c59c32a3e2033905 (diff) |
[PATCH] Get core dump code to work...
The file based core dump code was broken by pipe changes - a relative
llseek returns the absolute file position on success, not the relative
one, so dump_seek() always failed when invoked with non-zero current
position.
Only success/failure can be tested with relative lseek, we have to trust
kernel that on success we've got right file offset. With this fix in
place I have finally real core files instead of 1KB fragments...
Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
[ Cleaned it up a bit while here - use SEEK_CUR instead of hardcoding 1 ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 06435f3665f4..561006127902 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1152,7 +1152,7 @@ static int dump_write(struct file *file, const void *addr, int nr) | |||
1152 | static int dump_seek(struct file *file, loff_t off) | 1152 | static int dump_seek(struct file *file, loff_t off) |
1153 | { | 1153 | { |
1154 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | 1154 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { |
1155 | if (file->f_op->llseek(file, off, 1) != off) | 1155 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) |
1156 | return 0; | 1156 | return 0; |
1157 | } else { | 1157 | } else { |
1158 | char *buf = (char *)get_zeroed_page(GFP_KERNEL); | 1158 | char *buf = (char *)get_zeroed_page(GFP_KERNEL); |