Skip to content

Commit

Permalink
[POWERPC] spufs: Don't return -ENOSYS as extra notes size if spufs is…
Browse files Browse the repository at this point in the history
… not loaded

Because the SPU coredump code might be built as part of a module (spufs),
we have a stub which is called by the coredump code, this routine then calls
into spufs if it's loaded.

Unfortunately the stub returns -ENOSYS if spufs is not loaded, which is
interpreted by the coredump code as an extra note size of -38 bytes. This
leads to a corrupt core dump.

If spufs is not loaded there will be no SPU ELF notes to write, and so the
extra notes size will be == 0.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Sep 19, 2007
1 parent 59000b5 commit c1a7217
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/powerpc/platforms/cell/spu_coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ static DEFINE_MUTEX(spu_coredump_mutex);

int arch_notes_size(void)
{
long ret;
int ret;

ret = -ENOSYS;
mutex_lock(&spu_coredump_mutex);

if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
ret = spu_coredump_calls->arch_notes_size();
module_put(spu_coredump_calls->owner);
} else {
ret = 0;
}

mutex_unlock(&spu_coredump_mutex);

return ret;
}

Expand Down

0 comments on commit c1a7217

Please sign in to comment.