[PATCH] dracut-module-setup: Return from iscsi path immediately for hardward iscsi without iBFT

Dave Young dyoung at redhat.com
Fri Sep 25 06:39:01 UTC 2015


On 09/24/15 at 01:29pm, Minfei Huang wrote:
> Hardware iscsi can export the iscsi device before starting to load the
> kernel code, which setups the iscsi card using the config stored in
> hardward iscsi card memory.
> 
> kdump need not do anything for this sort of hardware iscsi card, if this
> card does not have the feature iBFT. IBFT can export the iscsi
> configuration from hardware iscsi card memroy to current running kernel.
> Thus iscsiadm cann't get the iscsi session info using "iscsiadm -m
> session -r /sys/block/xxx", due to limitation of iscsi info exported by
> kernel.
> 
> Once the machine is plugged in this sort of hardware iscsi card, kdump
> returns as soon as possible.

Since we do not know much about iscsi, could you describe the basic infomation
about them?

1. how many type of cases we should consider for iscsi?

2. what is the difference between them, how to diffrentiate them.

3. how to setup them (basic steps)

BTW, I found a basic documentation about initiator and targets:
https://www.thomas-krenn.com/en/wiki/ISCSI_Basics#iSCSI_Initiator

> 
> Signed-off-by: Minfei Huang <mhuang at redhat.com>
> ---
>  dracut-module-setup.sh | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index 9b398eb..e2fef9b 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -507,16 +507,6 @@ kdump_setup_iscsi_device() {
>      local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf"
>      local initiator_conf="/etc/iscsi/initiatorname.iscsi"
>  
> -    dinfo "Found iscsi component $1"
> -
> -    # Check once before getting explicit values, so we can output a decent
> -    # error message.
> -
> -    if ! /sbin/iscsiadm -m session -r ${path} >/dev/null ; then
> -        derror "Unable to find iscsi record for $path"
> -        return 1
> -    fi
> -

There may be other case for iscsiadm error out, so silent fail here?
Looks like Vivek intended to add such error message in original code.

>      tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
>      tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
>  
> @@ -583,7 +573,18 @@ kdump_check_iscsi_targets () {
>          until [[ -d sys || -d iscsi_session ]]; do
>              cd ..
>          done
> -        [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD"
> +        if [[ -d iscsi_session ]]; then
> +            dinfo "Found iscsi component $PWD"
> +
> +            # Hardware iscsi without the iBFT will fail to get
> +            # iscsi session info, and return non-zero
> +            # We need not do anything for this sort of hardware iscsi
> +            /sbin/iscsiadm -m session -r "$PWD" 2>&- >/dev/null
> +            if [ $? -eq 0 ]; then
> +                # start to take care of iBFT

It was target for software iscsi, so how to take care of iBFT?

> +                kdump_setup_iscsi_device "$PWD"
> +            fi
> +        fi
>      )
>  
>      [[ $hostonly ]] || [[ $mount_needs ]] && {
> -- 
> 2.1.0
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.fedoraproject.org
> https://lists.fedoraproject.org/mailman/listinfo/kexec


More information about the kexec mailing list