[PATCH] vmcore-dmesg: vmcore-dmesg: struct_val_u64() not casting u64 to u32
by WANG Chao
This is a backport of the following upstream commit:
commit 158d763
Author: WANG Chao <chaowang(a)redhat.com>
Date: Tue Jan 7 01:37:34 2014 +0800
vmcore-dmesg: struct_val_u64() not casting u64 to u32
It seems gcc doesn't check return type from inline function.
struct_val_u64() should return u64 otherwise upper 32bit is lost.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
timestamp in vmcore-dmesg is u64 type but it's truncated to u32, which
results in wrong time stamp. So let's backport this patch to fix this
issue.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
...esg-struct_val_u64-not-casting-u64-to-u32.patch | 31 ++++++++++++++++++++++
kexec-tools.spec | 2 ++
2 files changed, 33 insertions(+)
create mode 100644 kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
diff --git a/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
new file mode 100644
index 0000000..e2e43ff
--- /dev/null
+++ b/kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
@@ -0,0 +1,31 @@
+From 158d7638f1669a8d34def55ab81f10993e68e76a Mon Sep 17 00:00:00 2001
+From: WANG Chao <chaowang(a)redhat.com>
+Date: Tue, 7 Jan 2014 01:37:34 +0800
+Subject: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
+
+It seems gcc doesn't check return type from inline function.
+struct_val_u64() should return u64 otherwise upper 32bit is lost.
+
+Signed-off-by: WANG Chao <chaowang(a)redhat.com>
+Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
+Signed-off-by: Simon Horman <horms(a)verge.net.au>
+---
+ vmcore-dmesg/vmcore-dmesg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
+index 0f477c0..df14c89 100644
+--- a/vmcore-dmesg/vmcore-dmesg.c
++++ b/vmcore-dmesg/vmcore-dmesg.c
+@@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset)
+ return(file32_to_cpu(*(uint32_t *)(ptr + offset)));
+ }
+
+-static inline uint32_t struct_val_u64(char *ptr, unsigned int offset)
++static inline uint64_t struct_val_u64(char *ptr, unsigned int offset)
+ {
+ return(file64_to_cpu(*(uint64_t *)(ptr + offset)));
+ }
+--
+1.8.4.2
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 4bf50af..927a513 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -94,6 +94,7 @@ Patch613: kexec-tools-2.0.4-makedumpfile-Assign-non-printable-value-as-short-opt
Patch614: kexec-tools-2.0.4-makedumpfile-Add-help-and-man-message-for-help.patch
Patch615: kexec-tools-2.0.4-makedumpfile-Add-non-mmap-option-to-disable-mmap-manually.patch
Patch616: kexec-tools-2.0.4-makedumpfile-Fall-back-to-read-when-mmap-fails.patch
+Patch617: kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@@ -141,6 +142,7 @@ tar -z -x -v -f %{SOURCE19}
%patch614 -p1
%patch615 -p1
%patch616 -p1
+%patch617 -p1
tar -z -x -v -f %{SOURCE13}
--
1.8.4.2
10 years, 3 months
[PATCH 0/6] Add fence kdump support
by WANG Chao
This is a patchset to add fence kdump support.
In cluster environment, fence kdump is used to notify all the other
nodes that current is crashed and stop from being fenced off.
The patchset has the following features:
1. rebuild kdump initrd regarding timestamp of fence kdump config or cluster
configuration.
2. setup a required working environment for fence kdump in 2nd kernel.
3. fence_kdump_send notify other nodes to stop the crashed one being fenced off
before dumping process.
WANG Chao (5):
kdump-lib: add common variables and function for fence kdump
kdumpctl: rebuild kdump initramfs if cluster or fence_kdump config is
changed.
kdump.sh: send fence kdump message to other nodes in the cluster
module-setup.sh: setup fence kdump environment
module-setup: remove duplicated ip= line
arthur (1):
doc: Add kdump-in-cluster-environment.txt
dracut-kdump.sh | 15 +++++++++++
dracut-module-setup.sh | 54 ++++++++++++++++++++++++++++++++++++--
kdump-in-cluster-environment.txt | 56 ++++++++++++++++++++++++++++++++++++++++
kdump-lib.sh | 17 +++++++++++-
kdumpctl | 26 +++++++++++++++++++
kexec-tools.spec | 3 +++
6 files changed, 168 insertions(+), 3 deletions(-)
create mode 100644 kdump-in-cluster-environment.txt
--
1.8.4.2
10 years, 3 months
[PATCH 0/5] makedumpfile re-enable mmap
by WANG Chao
Hi,
I'd like to re-enable makedumpfile mmap(), since upstream patches are ready.
There are two commits that I want to backport:
1. makedumpfile: Fall back to read() when mmap() fails
2. makedumpfile: Add --non-mmap option to disable mmap() manually
#1 can be applied cleanly on top of our makedumpfile-1.5.4
#2 has conflicts, so I bring in two addtional patches. These two patches are trivial.
I think it's worth to backport #2 to have a switch between mmap and read. It
could be used as workaround when mmap has issues again.
v2 -> v1:
- fix upstream commit id [dyoung]
WANG Chao (5):
makedumpfile: Revert "makedumpfile: disable mmap"
makedumpfile: Assign non-printable value as short options
makedumpfile: Add help and man message for '--help'
makedumpfile: Add --non-mmap option to disable mmap() manually
makedumpfile: Fall back to read() when mmap() fails
...umpfile-Add-help-and-man-message-for-help.patch | 43 ++++
...-non-mmap-option-to-disable-mmap-manually.patch | 161 ++++++++++++++
...ssign-non-printable-value-as-short-option.patch | 244 +++++++++++++++++++++
...umpfile-Fall-back-to-read-when-mmap-fails.patch | 38 ++++
kexec-tools-2.0.4-makedumpfile-disable-mmap.patch | 36 ---
kexec-tools.spec | 11 +-
6 files changed, 494 insertions(+), 39 deletions(-)
create mode 100644 kexec-tools-2.0.4-makedumpfile-Add-help-and-man-message-for-help.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Add-non-mmap-option-to-disable-mmap-manually.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Assign-non-printable-value-as-short-option.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Fall-back-to-read-when-mmap-fails.patch
delete mode 100644 kexec-tools-2.0.4-makedumpfile-disable-mmap.patch
--
1.8.4.2
10 years, 3 months
[PATCH 0/5] makedumpfile re-enable mmap
by WANG Chao
Hi,
I'd like to re-enable makedumpfile mmap(), since upstream patches are ready.
There are two commits that I want to backport:
1. makedumpfile: Fall back to read() when mmap() fails
2. makedumpfile: Add --non-mmap option to disable mmap() manually
#1 can be applied cleanly on top of our makedumpfile-1.5.4
#2 has conflicts, so I bring in two addtional patches. These two patches are trivial.
I think it's worth to backport #2 to have a switch between mmap and read. It
could be used as workaround when mmap has issues again.
WANG Chao (5):
makedumpfile: Revert "makedumpfile: disable mmap"
makedumpfile: Assign non-printable value as short options
makedumpfile: Add help and man message for '--help'
makedumpfile: Add --non-mmap option to disable mmap() manually
makedumpfile: Fall back to read() when mmap() fails
...umpfile-Add-help-and-man-message-for-help.patch | 43 ++++
...-non-mmap-option-to-disable-mmap-manually.patch | 161 ++++++++++++++
...ssign-non-printable-value-as-short-option.patch | 244 +++++++++++++++++++++
...umpfile-Fall-back-to-read-when-mmap-fails.patch | 38 ++++
kexec-tools-2.0.4-makedumpfile-disable-mmap.patch | 36 ---
kexec-tools.spec | 11 +-
6 files changed, 494 insertions(+), 39 deletions(-)
create mode 100644 kexec-tools-2.0.4-makedumpfile-Add-help-and-man-message-for-help.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Add-non-mmap-option-to-disable-mmap-manually.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Assign-non-printable-value-as-short-option.patch
create mode 100644 kexec-tools-2.0.4-makedumpfile-Fall-back-to-read-when-mmap-fails.patch
delete mode 100644 kexec-tools-2.0.4-makedumpfile-disable-mmap.patch
--
1.8.4.2
10 years, 3 months
[PATCH v2] ssh dump: install random-seed from a new location
by WANG Chao
In ssh dump, we use random-seed to feed /dev/urandom. In later release
of systemd[1], random-seed is moved from /var/lib/random-seed to
/var/lib/systemd/random-seed. We need to adapt the change and also keep
backward compatibility with older systemd.
[1]: http://cgit.freedesktop.org/systemd/systemd/commit/?id=ef5bfcf668e6029faa...
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-kdump.sh | 7 ++++++-
dracut-module-setup.sh | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 4d8616f..a7672e1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -146,7 +146,12 @@ dump_ssh()
echo "kdump: saving to $_host:$_dir"
- cat /var/lib/random-seed > /dev/urandom
+ if [ -f /var/lib/random-seed ]; then
+ cat /var/lib/random-seed > /dev/urandom
+ elif [ -f /var/lib/systemd/random-seed ]; then
+ cat /var/lib/systemd/random-seed > /dev/urandom
+ fi
+
ssh -q $_opt $_host mkdir -p $_dir || return 1
save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" $_host
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c013430..5785820 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -398,7 +398,7 @@ install() {
>"$initdir/lib/dracut/no-emergency-shell"
if is_ssh_dump_target; then
- dracut_install /var/lib/random-seed || exit $?
+ dracut_install -o /var/lib/random-seed /var/lib/systemd/random-seed
fi
dracut_install -o /etc/adjtime /etc/localtime
inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"
--
1.8.4.2
10 years, 3 months
[PATCH] kdump.conf: uncomment default core_collector line
by WANG Chao
Having uncommented core_collector line in default kdump.conf would help
s-c-kdump determine which arguments to use without relying on hardcoded
values.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.conf b/kdump.conf
index 3c411fb..a106462 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -132,7 +132,7 @@
#ssh user(a)my.server.com
#sshkey /root/.ssh/kdump_id_rsa
path /var/crash
-#core_collector makedumpfile -l --message-level 1 -d 31
+core_collector makedumpfile -l --message-level 1 -d 31
#core_collector scp
#kdump_post /var/crash/scripts/kdump-post.sh
#kdump_pre /var/crash/scripts/kdump-pre.sh
--
1.8.4.2
10 years, 3 months