From: Jeff Dike Date: Tue, 26 Sep 2006 06:33:03 +0000 (-0700) Subject: [PATCH] uml: Improve SIGBUS diagnostics X-Git-Tag: v2.6.19-rc1~1089 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6edf428ed177e333863a8e5c37751a9ec176f241;p=linux-2.6-omap-h63xx.git [PATCH] uml: Improve SIGBUS diagnostics UML can get a SIGBUS anywhere if the tmpfs mount being used for its memory runs out of space. This patch adds a printk before the panic to provide a clue as to what likely went wrong. Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index ac70fa5a2e2..e5eeaf2b6af 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c @@ -227,9 +227,16 @@ void bad_segv(struct faultinfo fi, unsigned long ip) void relay_signal(int sig, union uml_pt_regs *regs) { - if(arch_handle_signal(sig, regs)) return; - if(!UPT_IS_USER(regs)) + if(arch_handle_signal(sig, regs)) + return; + + if(!UPT_IS_USER(regs)){ + if(sig == SIGBUS) + printk("Bus error - the /dev/shm or /tmp mount likely " + "just ran out of space\n"); panic("Kernel mode signal %d", sig); + } + current->thread.arch.faultinfo = *UPT_FAULTINFO(regs); force_sig(sig, current); }