[PATCH] Install nfsv4-related drivers when users specify nfs dumping via dracut_args
by Coiby Xu
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2140721
Currently, if users specify dumping to nfsv4 target via
dracut_args --mount "<NFS-server-ip>:/var/crash /mnt nfs defaults"
it fails with the following errors,
[ 5.159760] mount[446]: mount.nfs: Protocol not supported
[ 5.164502] systemd[1]: mnt.mount: Mount process exited, code=exited, status=32/n/a
[ 5.167616] systemd[1]: mnt.mount: Failed with result 'exit-code'.
[FAILED] Failed to mount /mnt.
This is because nfsv4-releted drivers are not installed to kdump initrd.
mkdumprd calls dracut with "--hostonly-mode strict". If nfsv4-related
drivers aren't loaded before calling dracut, they won't be installed.
When users specify nfs dumping via dracut_args, kexec-tools won't mount
the nfs fs beforehand hence nfsv4-related drivers won't be installed.
Note dracut only installs the nfs driver i.e. nfsv3 driver for "--mount
... nfs". So also install nfsv4-related drivers when users specify nfs
dumping via dracut_args. Since nfs_layout_nfsv41_files depends on nfsv4,
the nfsv4 driver will be installed automatically.
As for the reason why we support nfs dumping via dracut_args instead of
asking user to use the nfs directive, please refer to commit 74c6f464
("Support special mount information via 'dracut_args'").
Fixes: 4eedcae5 ("dracut-module-setup.sh: don't include multipath-hostonly")
Reported-by: rcheerla(a)redhat.com
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
mkdumprd | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 3e250e02..51ca4f01 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -420,6 +420,15 @@ while read -r config_opt config_val; do
verify_core_collector "$config_val"
;;
dracut_args)
+
+ # When users specify nfs dumping via dracut_args, kexec-tools won't
+ # mount nfs fs beforehand thus nfsv4-related drivers won't be installed
+ # because we call dracut with --hostonly-mode strict. So manually install
+ # nfsv4-related drivers.
+ if [[ $(get_dracut_args_fstype "$config_val") == nfs* ]]; then
+ add_dracut_arg "--add-drivers" nfs_layout_nfsv41_files
+ fi
+
while read -r dracut_arg; do
add_dracut_arg "$dracut_arg"
done <<< "$(echo "$config_val" | xargs -n 1 echo)"
--
2.38.1
1 week
[PATCH v2 00/13] various fixes and cleanups
by Philipp Rudo
Hi everybody,
here are a few patches before I go on Christmas vacation. I'll be back in
office on Jan 9th so you don't need to hurry to review them.
Patch 3 is a little bit special as in my opinion it only highlights the problem
but doesn't really fix it. For a proper fix one would need to move all
functions dracut-early-kdump.sh uses from kdump-lib to kdump-lib-initramfs and
make them POSIX compliant...
Thanks and see you next year
Philipp
---
v1->v2:
* incorporate Coibys comments, i.e. disable shellcheck in patch 2 rather than
quoting EARLY_KEXEC_ARGS and move image_time to check_files_modified and
make it local in patch 13.
Philipp Rudo (13):
kdumpctl: simplify check_failure_action_config
dracut-early-kdump: fix shellcheck findings
dracut-early-kdump: explicitly use bash
kdumpctl: merge check_current_{kdump,fadump}_status
mkfadumprd: drop unset globals from debug output
kdump-lib: always specify version in is_squash_available
unit tests: add tests for prepare_cmdline
kdumpctl: move aws workaround to kdump-lib
kdump-lib: fix prepare_cmdline
kdumpctl: cleanup 'start'
kdumpctl: cleanup 'stop'
kdumpctl: refractor check_rebuild
kdumpctl: make do_estimate more robust
.editorconfig | 2 +-
dracut-early-kdump.sh | 6 +-
kdump-lib.sh | 226 +++++++++++++++++--------------
kdumpctl | 296 +++++++++++++++--------------------------
mkfadumprd | 2 +-
spec/kdump-lib_spec.sh | 32 +++++
6 files changed, 272 insertions(+), 292 deletions(-)
mode change 100644 => 100755 mkfadumprd
--
2.39.0
1 month, 3 weeks
[PATCH] makedumpfile: Fix wrong exclusion of slab pages on Linux 6.2-rc1
by Coiby Xu
Resolves: bz2155754
Upstream: https://github.com/makedumpfile/makedumpfile
Conflict: None
commit 5f17bdd2128998a3eeeb4521d136a192222fadb6
Author: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Date: Wed Dec 21 11:06:39 2022 +0900
[PATCH] Fix wrong exclusion of slab pages on Linux 6.2-rc1
* Required for kernel 6.2
Kernel commit 130d4df57390 ("mm/sl[au]b: rearrange struct slab fields to
allow larger rcu_head"), which is contained in Linux 6.2-rc1 and later,
made the offset of slab.slabs equal to page.mapping's one. As a result,
"makedumpfile -d 8", which should exclude user data, excludes some slab
pages wrongly because isAnon() returns true when slab.slabs is an odd
number. With such dumpfiles, crash can fail to start session with an
error like this:
# crash vmlinux dumpfile
...
crash: page excluded: kernel virtual address: ffff8fa047ac2fe8 type: "xa_node shift"
Make isAnon() check that the page is not slab to fix this.
Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Reported-by: Baoquan He <bhe(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
...exclusion-of-slab-pages-on-Linux-6.2.patch | 81 +++++++++++++++++++
kexec-tools.spec | 2 +
2 files changed, 83 insertions(+)
create mode 100644 kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch
diff --git a/kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch b/kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch
new file mode 100644
index 00000000..5d91bc21
--- /dev/null
+++ b/kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch
@@ -0,0 +1,81 @@
+From 5f17bdd2128998a3eeeb4521d136a192222fadb6 Mon Sep 17 00:00:00 2001
+From: Kazuhito Hagio <k-hagio-ab(a)nec.com>
+Date: Wed, 21 Dec 2022 11:06:39 +0900
+Subject: [PATCH] [PATCH] Fix wrong exclusion of slab pages on Linux 6.2-rc1
+
+* Required for kernel 6.2
+
+Kernel commit 130d4df57390 ("mm/sl[au]b: rearrange struct slab fields to
+allow larger rcu_head"), which is contained in Linux 6.2-rc1 and later,
+made the offset of slab.slabs equal to page.mapping's one. As a result,
+"makedumpfile -d 8", which should exclude user data, excludes some slab
+pages wrongly because isAnon() returns true when slab.slabs is an odd
+number. With such dumpfiles, crash can fail to start session with an
+error like this:
+
+ # crash vmlinux dumpfile
+ ...
+ crash: page excluded: kernel virtual address: ffff8fa047ac2fe8 type: "xa_node shift"
+
+Make isAnon() check that the page is not slab to fix this.
+
+Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
+---
+ makedumpfile.c | 6 +++---
+ makedumpfile.h | 9 +++------
+ 2 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/makedumpfile-1.7.2/makedumpfile.c b/makedumpfile-1.7.2/makedumpfile.c
+index ff821eb..f403683 100644
+--- a/makedumpfile-1.7.2/makedumpfile.c
++++ b/makedumpfile-1.7.2/makedumpfile.c
+@@ -6502,7 +6502,7 @@ __exclude_unnecessary_pages(unsigned long mem_map,
+ */
+ else if ((info->dump_level & DL_EXCLUDE_CACHE)
+ && is_cache_page(flags)
+- && !isPrivate(flags) && !isAnon(mapping)) {
++ && !isPrivate(flags) && !isAnon(mapping, flags)) {
+ pfn_counter = &pfn_cache;
+ }
+ /*
+@@ -6510,7 +6510,7 @@ __exclude_unnecessary_pages(unsigned long mem_map,
+ */
+ else if ((info->dump_level & DL_EXCLUDE_CACHE_PRI)
+ && is_cache_page(flags)
+- && !isAnon(mapping)) {
++ && !isAnon(mapping, flags)) {
+ if (isPrivate(flags))
+ pfn_counter = &pfn_cache_private;
+ else
+@@ -6522,7 +6522,7 @@ __exclude_unnecessary_pages(unsigned long mem_map,
+ * - hugetlbfs pages
+ */
+ else if ((info->dump_level & DL_EXCLUDE_USER_DATA)
+- && (isAnon(mapping) || isHugetlb(compound_dtor))) {
++ && (isAnon(mapping, flags) || isHugetlb(compound_dtor))) {
+ pfn_counter = &pfn_user;
+ }
+ /*
+diff --git a/makedumpfile-1.7.2/makedumpfile.h b/makedumpfile-1.7.2/makedumpfile.h
+index 70a1a91..21dec7d 100644
+--- a/makedumpfile-1.7.2/makedumpfile.h
++++ b/makedumpfile-1.7.2/makedumpfile.h
+@@ -161,12 +161,9 @@ test_bit(int nr, unsigned long addr)
+ #define isSwapBacked(flags) test_bit(NUMBER(PG_swapbacked), flags)
+ #define isHWPOISON(flags) (test_bit(NUMBER(PG_hwpoison), flags) \
+ && (NUMBER(PG_hwpoison) != NOT_FOUND_NUMBER))
+-
+-static inline int
+-isAnon(unsigned long mapping)
+-{
+- return ((unsigned long)mapping & PAGE_MAPPING_ANON) != 0;
+-}
++#define isSlab(flags) test_bit(NUMBER(PG_slab), flags)
++#define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \
++ && !isSlab(flags))
+
+ #define PTOB(X) (((unsigned long long)(X)) << PAGESHIFT())
+ #define BTOP(X) (((unsigned long long)(X)) >> PAGESHIFT())
+--
+2.39.0
+
diff --git a/kexec-tools.spec b/kexec-tools.spec
index ea49eb2c..33656dc4 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -105,6 +105,7 @@ Requires: systemd-udev%{?_isa}
#
# Patches 601 onward are generic patches
#
+Patch601: kexec-tools-2.0.26-makedumpfile-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@@ -120,6 +121,7 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
+%patch601 -p1
%ifarch ppc
%define archdef ARCH=ppc
--
2.39.0
1 month, 3 weeks
[PATCH 00/13] various fixes and cleanups
by Philipp Rudo
Hi everybody,
here are a few patches before I go on Christmas vacation. I'll be back in
office on Jan 9th so you don't need to hurry to review them.
Patch 3 is a little bit special as in my opinion it only highlights the problem
but doesn't really fix it. For a proper fix one would need to move all
functions dracut-early-kdump.sh uses from kdump-lib to kdump-lib-initramfs and
make them POSIX compliant...
Thanks and see you next year
Philipp
Philipp Rudo (13):
kdumpctl: simplify check_failure_action_config
dracut-early-kdump: fix shellcheck findings
dracut-early-kdump: explicitly use bash
kdumpctl: merge check_current_{kdump,fadump}_status
mkfadumprd: drop unset globals from debug output
kdump-lib: always specify version in is_squash_available
unit tests: add tests for prepare_cmdline
kdumpctl: move aws workaround to kdump-lib
kdump-lib: fix prepare_cmdline
kdumpctl: cleanup 'start'
kdumpctl: cleanup 'stop'
kdumpctl: refractor check_rebuild
kdumpctl: make do_estimate more robust
.editorconfig | 2 +-
dracut-early-kdump.sh | 7 +-
kdump-lib.sh | 226 +++++++++++++++++---------------
kdumpctl | 287 +++++++++++++++--------------------------
mkfadumprd | 2 +-
spec/kdump-lib_spec.sh | 32 +++++
6 files changed, 266 insertions(+), 290 deletions(-)
mode change 100644 => 100755 mkfadumprd
--
2.38.1
2 months, 2 weeks