lszfcp: add linkdown case to host marker of extended output

Complements v2.9.0 commit 4036e80b26 ("lszfcp: add new output marker
for non-good FCP devices (hosts)").

Otherwise "linkdown" shows as "failed" because linkdown happens to be
the one special case that also sets the failed status flag of the
FCP device (host). Linkdown is kind of benign compared to other cases
where the FCP device is in failed status.

Examples:
$ lszfcp -He
0.0.194a host3 linkdown

$ lszfcp -HeV
/sys/devices/css0/0.0.0004/0.0.194a linkdown
/sys/class/fc_host/host3
/sys/class/scsi_host/host3

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2021-08-03 17:34:35 +02:00
committed by Jan Höppner
parent 38b520ab4c
commit 45e3f016f4

View File

@@ -203,6 +203,7 @@ $(readlink -e $HOST_PATH)/-"
read ONLINE < $ADAPTER_PATH/online
read AVAILABILITY < $ADAPTER_PATH/availability
[ -r "$SYSFS/class/fc_host/$SCSI_HOST/port_state" ] && read PORT_STATE < "$SYSFS/class/fc_host/$SCSI_HOST/port_state"
[ -r $ADAPTER_PATH/failed ] && read FAILED < $ADAPTER_PATH/failed
DEFUNCT=${ADAPTER_PATH%/*} # strip devbusid
DEFUNCT=${DEFUNCT##*/} # basename
@@ -212,6 +213,8 @@ $(readlink -e $HOST_PATH)/-"
HOSTMARKER=" defunct"
elif [ "$ONLINE" = "0" ]; then
HOSTMARKER=" offline"
elif [ "$PORT_STATE" = "Linkdown" ]; then
HOSTMARKER=" linkdown"
elif [ "$FAILED" = "1" ]; then
HOSTMARKER=" failed"
elif [ "$AVAILABILITY" != "good" ]; then