From 5a7bf404c79901eacfc89b16956d49046b293e91 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 5 Apr 2022 07:03:07 -0400 Subject: [PATCH] import powerpc-utils-1.3.9-7.el9_0 --- ...ootlist-fix-nvme-support-in-ANA-mode.patch | 78 +++++++++++++++++++ ...13686e69123c00406727ea44e52873a1e2c4.patch | 41 ++++++++++ ...169a87cc146bcd3844f266abef903d8d3c54.patch | 30 +++++++ SPECS/powerpc-utils.spec | 11 ++- 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 SOURCES/powerpc-utils-1.3.9-bootlist-fix-nvme-support-in-ANA-mode.patch create mode 100644 SOURCES/powerpc-utils-c44313686e69123c00406727ea44e52873a1e2c4.patch create mode 100644 SOURCES/powerpc-utils-d512169a87cc146bcd3844f266abef903d8d3c54.patch diff --git a/SOURCES/powerpc-utils-1.3.9-bootlist-fix-nvme-support-in-ANA-mode.patch b/SOURCES/powerpc-utils-1.3.9-bootlist-fix-nvme-support-in-ANA-mode.patch new file mode 100644 index 0000000..699a6af --- /dev/null +++ b/SOURCES/powerpc-utils-1.3.9-bootlist-fix-nvme-support-in-ANA-mode.patch @@ -0,0 +1,78 @@ +commit 98c8519b832ddb93021c3eeb8eee0f5e51c49197 +Author: Wen Xiong +Date: Thu Sep 30 08:53:13 2021 -0500 + + ofpathname: Fix nvme support in ANA mode + + nvme_core.multipath is Y by defaut in the latest rhel + and sles linux release. The patch fixes the issue when + nvme_core.multipath=Y + + Signed-off-by: Wen Xiong + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/ofpathname b/scripts/ofpathname +index c4d81f2..310ee3e 100755 +--- a/scripts/ofpathname ++++ b/scripts/ofpathname +@@ -640,6 +640,7 @@ l2of_nvme() + # disk: nvmeX, nvmeXnY; not nvmeXnYpZ + local devdisk="${DEVICE%p[0-9]*}" + ++ local dev_ctrl=${devdisk%n[0-9]*} + # namespace id: Y in nvmeXnY, nvmeXnYpZ + local devnsid="${devdisk#nvme[0-9]*n}" + if [[ $devnsid = $devdisk ]]; then +@@ -656,7 +657,7 @@ l2of_nvme() + local dir + local found=0 + +- for dir in `$FIND /sys/devices -name "$DEVICE"`; do ++ for dir in `$FIND /sys/devices -name "$dev_ctrl"`; do + cd $dir + + goto_dir $PWD "device/devspec" +@@ -666,8 +667,10 @@ l2of_nvme() + found=1 + if [[ -n $devnsid ]]; then + # Linux logical nsid might not match nvme controller nsid +- goto_dir $dir "nsid" +- devnsid=`$CAT $PWD/nsid | tr -d '\000'` ++ for nsid_dir in `$FIND /sys/devices -name "DEVICE"`; do ++ goto_dir $dir_dir "nsid" ++ devnsid=`$CAT $PWD/nsid | tr -d '\000'` ++ done + fi + break + fi +@@ -1056,7 +1059,8 @@ ofpathname_to_logical() + + # Remove any possible partition reference + PART=$(expr "$DEVICE" : '.*\(:[0-9]\)') +- if [[ -n $PART ]] ; then ++ if [[ -n $PART ]] && \ ++ [[ $DEVTYPE != "nvme" ]]; then + PART=${PART:1} + DEVICE=${DEVICE%:[0-9]} + fi +@@ -1083,7 +1087,8 @@ ofpathname_to_logical() + fi + + # Add any previously stripped partition reference +- if [[ -n $PART ]] ; then ++ if [[ -n $PART ]] && \ ++ [[ $DEVTYPE != "nvme" ]]; then + LOGICAL_DEVNAME=$LOGICAL_DEVNAME$PART + fi + +@@ -1650,6 +1655,10 @@ of2l_nvme() + continue + fi + ++ if [[ "$PWD" == *"nvme-fabrics"* ]]; then ++ continue ++ fi ++ + goto_dir $PWD "devspec" + local devspec=`$CAT ./devspec 2>/dev/null` + diff --git a/SOURCES/powerpc-utils-c44313686e69123c00406727ea44e52873a1e2c4.patch b/SOURCES/powerpc-utils-c44313686e69123c00406727ea44e52873a1e2c4.patch new file mode 100644 index 0000000..6909b3a --- /dev/null +++ b/SOURCES/powerpc-utils-c44313686e69123c00406727ea44e52873a1e2c4.patch @@ -0,0 +1,41 @@ +commit c44313686e69123c00406727ea44e52873a1e2c4 +Author: Tyrel Datwyler +Date: Sat Mar 5 15:31:25 2022 -0600 + + bootlist: fix passing -l flag to kpartx as -p delimiter value + + When $delim is empty in dm_to_part() the kpartx command will wrongly use + the -l option flag as the delimiter input for the -p flag. Fix this be + quoting $delim. + + The variable delim is NULL (empty) in this case and it shows wrong + partitions. + + kpartx -p -l /dev/mapper/mpatha + mpatha-l1 : 0 8192 /dev/mapper/mpatha 8192 + mpatha-l2 : 0 2097152 /dev/mapper/mpatha 16384 + mpatha-l3 : 0 14663680 /dev/mapper/mpatha 2113536 + + With quotation it shows correct correct. + + kpartx -p "" -l /dev/mapper/mpatha + mpatha1 : 0 8192 /dev/mapper/mpatha 8192 + mpatha2 : 0 2097152 /dev/mapper/mpatha 16384 + mpatha3 : 0 14663680 /dev/mapper/mpatha 2113536 + + Suggested-by: Than Ngo + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/bootlist b/scripts/bootlist +index e36f062..6187d6f 100755 +--- a/scripts/bootlist ++++ b/scripts/bootlist +@@ -270,7 +270,7 @@ dm_to_part() + done + + +- kpartx -p $delim -l $dmmapper | while read kp ; do ++ kpartx -p "$delim" -l "$dmmapper" | while read kp ; do + kpname=${kp%% *} + tmajor=$(stat -L --format="%t" /dev/mapper/$kpname 2>/dev/null) + tminor=$(stat -L --format="%T" /dev/mapper/$kpname 2>/dev/null) diff --git a/SOURCES/powerpc-utils-d512169a87cc146bcd3844f266abef903d8d3c54.patch b/SOURCES/powerpc-utils-d512169a87cc146bcd3844f266abef903d8d3c54.patch new file mode 100644 index 0000000..875fab4 --- /dev/null +++ b/SOURCES/powerpc-utils-d512169a87cc146bcd3844f266abef903d8d3c54.patch @@ -0,0 +1,30 @@ +commit d512169a87cc146bcd3844f266abef903d8d3c54 +Author: Tyrel Datwyler +Date: Sat Mar 5 15:34:06 2022 -0600 + + bootlist: fix invalid hex number message + + In dm_to_part() when kpartx returns no partitions tmajor and tminor are + empty. As a result the $(printf %d:%d 0x$tmajor 0x$tminor) command + subsititution reports the following error: + + /usr/sbin/bootlist: line 277: printf: 0x: invalid hex number + + Fix this by redirecting stderr to /dev/null. + + Suggested-by: Than Ngo + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/bootlist b/scripts/bootlist +index 6187d6f..b5cfbd9 100755 +--- a/scripts/bootlist ++++ b/scripts/bootlist +@@ -277,7 +277,7 @@ dm_to_part() + tmajmin=$(printf "%d:%d" 0x$tmajor 0x$tminor) + if [[ "$tmajmin" = "$dmpmajmin" ]]; then + partstart=${kp##* } +- for part in `ls -1d /sys/block/$sddev/$sddev*`; do ++ for part in `ls -1d /sys/block/$sddev/$sddev* 2>/dev/null`; do + pstart=$(cat $part/start 2>/dev/null) + if [[ "$pstart" -eq "$partstart" ]] ; then + echo "${part##*/}" diff --git a/SPECS/powerpc-utils.spec b/SPECS/powerpc-utils.spec index a4f1fd3..210c7c1 100644 --- a/SPECS/powerpc-utils.spec +++ b/SPECS/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.3.9 -Release: 6%{?dist} +Release: 7%{?dist} Summary: PERL-based scripts for maintaining and servicing PowerPC systems License: GPLv2 @@ -36,6 +36,10 @@ Patch8: powerpc-utils-support-vnic-as-backup-device-for-HNV.patch # fixed hexdump format Patch9: powerpc-utils-1.3.9-fix-hexdump-format.patch Patch10: powerpc-utils-1.3.9-sanitize-devspec-output.patch +# bootlist fix +Patch11: powerpc-utils-1.3.9-bootlist-fix-nvme-support-in-ANA-mode.patch +Patch12: powerpc-utils-c44313686e69123c00406727ea44e52873a1e2c4.patch +Patch13: powerpc-utils-d512169a87cc146bcd3844f266abef903d8d3c54.patch %description PERL-based scripts for maintaining and servicing PowerPC systems. @@ -205,6 +209,11 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || : %changelog +* Thu Mar 17 2022 Than Ngo - 1.3.9-7 +- fix invalid hex number message +- ofpathname: Fix nvme support in ANA mode + Resolves: #2017652 + * Fri Jan 14 2022 Than Ngo - 1.3.9-6 - Resolves: #2039201, santize devspec output of a newline if one is present