linux/fs/proc
Simon Horman 85a0ee342e kdump: add is_vmcore_usable() and vmcore_unusable()
The usage of elfcorehdr_addr has changed recently such that being set to
ELFCORE_ADDR_MAX is used by is_kdump_kernel() to indicate if the code is
executing in a kernel executed as a crash kernel.

However, arch/ia64/kernel/setup.c:reserve_elfcorehdr will rest
elfcorehdr_addr to ELFCORE_ADDR_MAX on error, which means any subsequent
calls to is_kdump_kernel() will return 0, even though they should return
1.

Ok, at this point in time there are no subsequent calls, but I think its
fair to say that there is ample scope for error or at the very least
confusion.

This patch add an extra state, ELFCORE_ADDR_ERR, which indicates that
elfcorehdr_addr was passed on the command line, and thus execution is
taking place in a crashdump kernel, but vmcore can't be used for some
reason.  This is tested for using is_vmcore_usable() and set using
vmcore_unusable().  A subsequent patch makes use of this new code.

To summarise, the states that elfcorehdr_addr can now be in are as follows:

ELFCORE_ADDR_MAX: not a crashdump kernel
ELFCORE_ADDR_ERR: crashdump kernel but vmcore is unusable
any other value:  crash dump kernel and vmcore is usable

Signed-off-by: Simon Horman <horms@verge.net.au>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20 08:52:40 -07:00
..
array.c proc: remove now unneeded ADDBUF macro 2008-10-10 04:18:58 +04:00
base.c proc: remove kernel.maps_protect 2008-10-10 04:24:51 +04:00
generic.c proc: more debugging for "already registered" case 2008-09-13 14:41:50 -07:00
inode-alloc.txt
inode.c proc: fix return value of proc_reg_open() in "too late" case 2008-10-10 04:18:54 +04:00
internal.h proc: remove kernel.maps_protect 2008-10-10 04:24:51 +04:00
Kconfig proc: move PROC_PAGE_MONITOR to fs/proc/Kconfig 2008-10-10 04:18:57 +04:00
kcore.c elf: use ELF_CORE_EFLAGS for kcore ELF header flags 2008-07-25 10:53:42 -07:00
kmsg.c move proc_kmsg_operations to fs/proc/internal.h 2008-07-25 10:53:44 -07:00
Makefile
mmu.c
nommu.c /proc/self/maps doesn't display the real file offset 2008-08-20 15:40:30 -07:00
proc_devtree.c
proc_misc.c vmstat: mlocked pages statistics 2008-10-20 08:52:31 -07:00
proc_net.c netns: make get_proc_net() static 2008-07-22 14:19:19 -07:00
proc_sysctl.c proc: make grab_header() static 2008-10-10 04:18:56 +04:00
proc_tty.c tty: Ldisc revamp 2008-07-20 17:12:34 -07:00
root.c proc: introduce proc_create_data to setup de->data 2008-04-29 08:06:20 -07:00
task_mmu.c proc: remove kernel.maps_protect 2008-10-10 04:24:51 +04:00
task_nommu.c proc: remove kernel.maps_protect 2008-10-10 04:24:51 +04:00
vmcore.c kdump: add is_vmcore_usable() and vmcore_unusable() 2008-10-20 08:52:40 -07:00