Currently, dumping to iSCSI target fails because the global array (unique_netifs) that stores the network interfaces needed by kdump is empty. The root cause is change of the array made in a subshell (a child process) is inaccessible to the parent process. So don't run kdump_check_setup_iscsi in a subshell.
Fixes: 63c3805c ("Set up kdump network by directly copying NM connection profile to initrd") Signed-off-by: Coiby Xu coxu@redhat.com --- dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 0cac3bde..1fa2a789 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -809,7 +809,7 @@ kdump_check_iscsi_targets() { # If our prerequisites are not met, fail anyways. type -P iscsistart > /dev/null || return 1
- kdump_check_setup_iscsi() ( + kdump_check_setup_iscsi() { local _dev _dev=$1
@@ -819,7 +819,7 @@ kdump_check_iscsi_targets() { cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD" - ) + }
[[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi
On Fri, Nov 25, 2022 at 12:39 PM Coiby Xu coxu@redhat.com wrote:
Currently, dumping to iSCSI target fails because the global array (unique_netifs) that stores the network interfaces needed by kdump is empty. The root cause is change of the array made in a subshell (a child process) is inaccessible to the parent process. So don't run kdump_check_setup_iscsi in a subshell.
Fixes: 63c3805c ("Set up kdump network by directly copying NM connection profile to initrd") Signed-off-by: Coiby Xu coxu@redhat.com
dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 0cac3bde..1fa2a789 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -809,7 +809,7 @@ kdump_check_iscsi_targets() { # If our prerequisites are not met, fail anyways. type -P iscsistart > /dev/null || return 1
- kdump_check_setup_iscsi() (
- kdump_check_setup_iscsi() { local _dev _dev=$1
@@ -819,7 +819,7 @@ kdump_check_iscsi_targets() { cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD"
- )
}
[[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi
-- 2.38.1
Reviewed-by: Pingfan Liu piliu@redhat.com
On Fri, Nov 25, 2022 at 01:48:41PM +0800, Pingfan Liu wrote:
On Fri, Nov 25, 2022 at 12:39 PM Coiby Xu coxu@redhat.com wrote:
Currently, dumping to iSCSI target fails because the global array (unique_netifs) that stores the network interfaces needed by kdump is empty. The root cause is change of the array made in a subshell (a child process) is inaccessible to the parent process. So don't run kdump_check_setup_iscsi in a subshell.
Fixes: 63c3805c ("Set up kdump network by directly copying NM connection profile to initrd") Signed-off-by: Coiby Xu coxu@redhat.com
dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 0cac3bde..1fa2a789 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -809,7 +809,7 @@ kdump_check_iscsi_targets() { # If our prerequisites are not met, fail anyways. type -P iscsistart > /dev/null || return 1
- kdump_check_setup_iscsi() (
- kdump_check_setup_iscsi() { local _dev _dev=$1
@@ -819,7 +819,7 @@ kdump_check_iscsi_targets() { cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD"
- )
}
[[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi
-- 2.38.1
Reviewed-by: Pingfan Liu piliu@redhat.com
Patch merged, thanks for the review!
On Fri, 25 Nov 2022 12:33:10 +0800 Coiby Xu coxu@redhat.com wrote:
Currently, dumping to iSCSI target fails because the global array (unique_netifs) that stores the network interfaces needed by kdump is empty. The root cause is change of the array made in a subshell (a child process) is inaccessible to the parent process. So don't run kdump_check_setup_iscsi in a subshell.
Fixes: 63c3805c ("Set up kdump network by directly copying NM connection profile to initrd") Signed-off-by: Coiby Xu coxu@redhat.com
dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 0cac3bde..1fa2a789 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -809,7 +809,7 @@ kdump_check_iscsi_targets() { # If our prerequisites are not met, fail anyways. type -P iscsistart > /dev/null || return 1
- kdump_check_setup_iscsi() (
- kdump_check_setup_iscsi() {
Wow, I had no clue that this syntax is even allowed... Good catch!
Thanks Philipp
local _dev _dev=$1@@ -819,7 +819,7 @@ kdump_check_iscsi_targets() { cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD"
- )
}
[[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi