]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
[POWERPC] spufs: Don't return -ENOSYS as extra notes size if spufs is not loaded
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 19 Sep 2007 04:38:12 +0000 (14:38 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 19 Sep 2007 05:12:18 +0000 (15:12 +1000)
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>
arch/powerpc/platforms/cell/spu_coredump.c

index 4fd37ff1e210c29c17eff7c22966d7b05052ac0b..656a8c52cd3819cba3bb9ad9667fb6b6115a094e 100644 (file)
@@ -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;
 }