summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMateusz Guzik <mguzik@redhat.com>2016-06-05 23:14:14 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-06-07 22:07:09 -0400
commit1607f09c226d1378439c411baaaa020042750338 (patch)
tree664e5239468f2bc978c6b8c6f2fb64904c20f7e9 /arch
parenta01e718f7241c53f564402f7acff373eed5bd166 (diff)
downloadlinux-1607f09c226d1378439c411baaaa020042750338.tar.bz2
coredump: fix dumping through pipes
The offset in the core file used to be tracked with ->written field of the coredump_params structure. The field was retired in favour of file->f_pos. However, ->f_pos is not maintained for pipes which leads to breakage. Restore explicit tracking of the offset in coredump_params. Introduce ->pos field for this purpose since ->written was already reused. Fixes: a00839395103 ("get rid of coredump_params->written"). Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Mateusz Guzik <mguzik@redhat.com> Reviewed-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 84fb984f29c1..85c85eb3e245 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -172,7 +172,7 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
if (rc < 0)
goto out;
- skip = roundup(cprm->file->f_pos - total + sz, 4) - cprm->file->f_pos;
+ skip = roundup(cprm->pos - total + sz, 4) - cprm->pos;
if (!dump_skip(cprm, skip))
goto Eio;
out: