From 45e3f016f4f029fbca1e2dae83c82ead4d2bc947 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Tue, 3 Aug 2021 17:34:35 +0200 Subject: [PATCH] lszfcp: add linkdown case to host marker of extended output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complements v2.9.0 commit 4036e80b265d ("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 Reviewed-by: Benjamin Block Reviewed-by: Fedor Loshakov Signed-off-by: Jan Höppner --- zconf/lszfcp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zconf/lszfcp b/zconf/lszfcp index 4685c397..0dff9246 100755 --- a/zconf/lszfcp +++ b/zconf/lszfcp @@ -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