aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-19 00:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-19 01:12:18 -0400
commitc1a72173ab156306666cb531f891f32e4e21d592 (patch)
tree0bab92498bec28507bcc12e88434ce408e90318d /arch
parent59000b53c7ea07531018b6cf1f5fcd21e881867a (diff)
[POWERPC] spufs: Don't return -ENOSYS as extra notes size if spufs is 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spu_coredump.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spu_coredump.c b/arch/powerpc/platforms/cell/spu_coredump.c
index 4fd37ff1e210..656a8c52cd38 100644
--- a/arch/powerpc/platforms/cell/spu_coredump.c
+++ b/arch/powerpc/platforms/cell/spu_coredump.c
@@ -31,15 +31,19 @@ static DEFINE_MUTEX(spu_coredump_mutex);
31 31
32int arch_notes_size(void) 32int arch_notes_size(void)
33{ 33{
34 long ret; 34 int ret;
35 35
36 ret = -ENOSYS;
37 mutex_lock(&spu_coredump_mutex); 36 mutex_lock(&spu_coredump_mutex);
37
38 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) { 38 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
39 ret = spu_coredump_calls->arch_notes_size(); 39 ret = spu_coredump_calls->arch_notes_size();
40 module_put(spu_coredump_calls->owner); 40 module_put(spu_coredump_calls->owner);
41 } else {
42 ret = 0;
41 } 43 }
44
42 mutex_unlock(&spu_coredump_mutex); 45 mutex_unlock(&spu_coredump_mutex);
46
43 return ret; 47 return ret;
44} 48}
45 49