File powerpc-utils.bug-1039710_ofpathname-avoid-duplicate-entries-of-vFC-devices.patch of Package powerpc-utils.4891
From 25b8f7d67fb3acee0970cd36f24dc17fac1f6dc3 Mon Sep 17 00:00:00 2001
From: Pawan K Singh5 <pawan123@linux.vnet.ibm.com>
Date: Mon, 10 Apr 2017 15:00:28 +0530
Subject: [PATCH] ofpathname : avoid duplicate entries of vFC devices
Adding support to avoid the duplicate entries of a Open Firmware device path to
logical device path for vfc-client devices.
The problem can be reproduced with the bootlist command
# bootlist -m normal /dev/sdd /dev/sds /dev/sdf /dev/sdv
# bootlist -m normal -r
/vdevice/vfc-client@30000899/disk@500507680b2255fe
/vdevice/vfc-client@30000899/disk@500507680b2255ff
/vdevice/vfc-client@3000089a/disk@500507680b2255fe
/vdevice/vfc-client@3000089a/disk@500507680b2255ff
# bootlist -m normal -o
sda---------------->expected "sdd"
sdp---------------->expected "sds"
sda---------------->expected "sdf"
sdp---------------->expected "sdv"
So, this patch check the duplicate entries of logical names of vFC devices at of2l_vfc()
and display specified bootlist :
# bootlist -m normal -r
/vdevice/vfc-client@30000899/disk@500507680b2255fe
/vdevice/vfc-client@30000899/disk@500507680b2255ff
/vdevice/vfc-client@3000089a/disk@500507680b2255fe
/vdevice/vfc-client@3000089a/disk@500507680b2255ff
# bootlist -m normal -o
sdd
sds
sdf
sdv
Signed-off-by: Pawan K Singh5 <pawan123@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
scripts/ofpathname | 2 ++
1 file changed, 2 insertions(+)
Index: powerpc-utils-1.3.2/scripts/ofpathname
===================================================================
--- powerpc-utils-1.3.2.orig/scripts/ofpathname
+++ powerpc-utils-1.3.2/scripts/ofpathname
@@ -1490,8 +1490,10 @@ of2l_vfc()
local wwpn=`get_fc_wwpn "$link/../../fc_remote_ports*"`
if [[ $vfc_lun = $OF_LUN && $wwpn = $OF_WWPN ]]; then
+ if [[ $OF_PATH = $DEVPATH ]]; then
LOGICAL_DEVNAME="${dir##*/}"
return
+ fi
fi
done
}