Skip to content

Commit

Permalink
fix(zfcp_rules): use the right wwpn and lun vars and support new devi…
Browse files Browse the repository at this point in the history
…ce format

Commit c8e5312 introduced a regression that
causes the parsed `_wwpn` and `_lun` from SCSI device nodes to not be passed
to the `create_udev_rule` function.

Also, the format of these udev-created SCSI device nodes has changed, now it
looks like: `ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>-part<n>`

Fixes c8e5312
  • Loading branch information
aafeijoo-suse committed Feb 28, 2024
1 parent 4980bad commit fb0677e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules.d/95zfcp_rules/parse-zfcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,18 @@ for zfcp_arg in $(getargs root=) $(getargs resume=); do
IFS="-"
set -- "$ccw_arg"
IFS="$OLDIFS"
_wwpn=${4%:*}
_lun=${4#*:}
create_udev_rule "$2" "$wwpn" "$lun"
# The format of udev-created SCSI device nodes has changed from:
# ccw-<device_bus_id>-zfcp-<wwpn>:<lun>-part<n>
# to:
# ccw-<device_bus_id>-fc-<wwpn>-lun-<lun>-part<n>
if [[ $3 == "fc" ]] && [[ $5 == "lun" ]]; then
_wwpn="$4"
_lun="$6"
else
_wwpn=${4%:*}
_lun=${4#*:}
fi
create_udev_rule "$2" "$_wwpn" "$_lun"
fi
)
done

0 comments on commit fb0677e

Please sign in to comment.