Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729853 > unrolled thread

[PATCH 3.16 104/233] powerpc/spufs: Fix coredump of SPU contexts

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-09-10 01:40 +0200
Last post2017-09-10 01:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 104/233] powerpc/spufs: Fix coredump of SPU contexts Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:40 +0200

#1729853 — [PATCH 3.16 104/233] powerpc/spufs: Fix coredump of SPU contexts

FromBen Hutchings <ben@decadent.org.uk>
Date2017-09-10 01:40 +0200
Subject[PATCH 3.16 104/233] powerpc/spufs: Fix coredump of SPU contexts
Message-ID<unXvZ-401-47@gated-at.bofh.it>
3.16.48-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Ellerman <mpe@ellerman.id.au>

commit 99acc9bede06bbb2662aafff51f5b9e529fa845e upstream.

If a process dumps core while it has SPU contexts active then we have
code to also dump information about the SPU contexts.

Unfortunately it's been broken for 3 1/2 years, and we didn't notice. In
commit 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers") the nread
variable was removed and rc used instead. That means when the loop exits
successfully, rc has the number of bytes read, but it's then used as the
return value for the function, which should return 0 on success.

So fix it by setting rc = 0 before returning in the success case.

Fixes: 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/powerpc/platforms/cell/spufs/coredump.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -174,6 +174,8 @@ static int spufs_arch_write_note(struct
 	if (!dump_skip(cprm,
 		       roundup(cprm->written - total + sz, 4) - cprm->written))
 		goto Eio;
+
+	rc = 0;
 out:
 	free_page((unsigned long)buf);
 	return rc;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web