diff --git a/0001-rescan-scsi-bus.sh-fix-multipath-resize-without-upda.patch b/0001-rescan-scsi-bus.sh-fix-multipath-resize-without-upda.patch new file mode 100644 index 0000000..ab0c83b --- /dev/null +++ b/0001-rescan-scsi-bus.sh-fix-multipath-resize-without-upda.patch @@ -0,0 +1,27 @@ +From 89427a6328a737b6a64104a6988e4ab319f239c7 Mon Sep 17 00:00:00 2001 +From: Douglas Gilbert +Date: Mon, 16 Oct 2023 14:59:21 +0000 +Subject: [PATCH 1/3] rescan-scsi-bus.sh: fix multipath resize without update, + https://github.com/doug-gilbert/sg3_utils/pull/43.diff +X-Patchwork-Bot: notify + +git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@1055 6180dd3e-e324-4e3e-922d-17de1ae2f315 +--- + scripts/rescan-scsi-bus.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 0c25dbb1..7d74d90f 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -1088,6 +1088,7 @@ findresized() + local mpathsize= + declare -a mpathsizes + ++ [ -e "$TMPLUNINFOFILE" ] || getallmultipathinfo + if [ -z "$lunsearch" ] ; then + devs=$(ls /sys/class/scsi_device/) + else +-- +2.44.0 + diff --git a/0002-rescan-scsi-bus.sh-remove-tmp-rescan-scsi-mpath-info.patch b/0002-rescan-scsi-bus.sh-remove-tmp-rescan-scsi-mpath-info.patch new file mode 100644 index 0000000..a17317a --- /dev/null +++ b/0002-rescan-scsi-bus.sh-remove-tmp-rescan-scsi-mpath-info.patch @@ -0,0 +1,58 @@ +From 593cb078d4e91591aa3be823715f11888b21f8e4 Mon Sep 17 00:00:00 2001 +From: Douglas Gilbert +Date: Tue, 17 Oct 2023 20:41:37 +0000 +Subject: [PATCH 2/3] rescan-scsi-bus.sh: remove + /tmp/rescan-scsi-mpath-info.txt; + https://github.com/doug-gilbert/sg3_utils/pull/44.diff +X-Patchwork-Bot: notify + +git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@1056 6180dd3e-e324-4e3e-922d-17de1ae2f315 +--- + scripts/rescan-scsi-bus.sh | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 7d74d90f..188d071c 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -7,7 +7,16 @@ + VERSION="20230413" + SCAN_WILD_CARD=4294967295 + +-TMPLUNINFOFILE="/tmp/rescan-scsi-mpath-info.txt" ++CLEANUP=: ++trap 'eval "$CLEANUP"' 0 ++TMPD=$(mktemp -d /tmp/rsb.XXXXXXXX) ++[ "$TMPD" ] || { ++ echo failed to create temporary directory >&2 ++ exit 1 ++} ++CLEANUP='rm -rf "$TMPD";'"$CLEANUP" ++ ++TMPLUNINFOFILE="$TMPD/rescan-scsi-mpath-info.txt" + + setcolor () + { +@@ -818,9 +827,9 @@ findremapped() + mpaths="" + local tmpfile= + +- tmpfile=$(mktemp /tmp/rescan-scsi-bus.XXXXXXXX 2> /dev/null) ++ tmpfile=$(mktemp "$TMPD/rescan-scsi-bus.XXXXXXXX" 2> /dev/null) + if [ -z "$tmpfile" ] ; then +- tmpfile="/tmp/rescan-scsi-bus.$$" ++ tmpfile="$TMPD/rescan-scsi-bus.$$" + rm -f $tmpfile + fi + +@@ -874,7 +883,6 @@ findremapped() + echo "$SCSISTR" + incrchgd "$hctl" + done < $tmpfile +- rm -f $tmpfile + + if [ -n "$mp_enable" ] && [ -n "$mpaths" ] ; then + echo "Updating multipath device mappings" +-- +2.44.0 + diff --git a/0003-rescan-scsi-bus.sh-fix-for-github.com-doug-gilbert-s.patch b/0003-rescan-scsi-bus.sh-fix-for-github.com-doug-gilbert-s.patch new file mode 100644 index 0000000..3f8caa9 --- /dev/null +++ b/0003-rescan-scsi-bus.sh-fix-for-github.com-doug-gilbert-s.patch @@ -0,0 +1,30 @@ +From bc99b8db2cf8afd04b1f9d68e9bd4f9d847b3c6f Mon Sep 17 00:00:00 2001 +From: Douglas Gilbert +Date: Thu, 21 Dec 2023 04:35:26 +0000 +Subject: [PATCH 3/3] rescan-scsi-bus.sh: fix for + github.com/doug-gilbert/sg3_utils/issues/46 +X-Patchwork-Bot: notify + +git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@1076 6180dd3e-e324-4e3e-922d-17de1ae2f315 +--- + scripts/rescan-scsi-bus.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 188d071c..52991e1e 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -1240,7 +1240,9 @@ if [ -x /usr/bin/sg_inq ] ; then + if [ "$sg_turs_version" -gt 353 ] ; then + sg_turs_opt="--ascq=0x3a" + else +- sg_turs_opt="" ++ # Not really interested in timing a TUR but an empty string such as ++ # "" gets interpreted on the command line as a positional parameter. ++ sg_turs_opt="-t" + fi + else + echo "WARN: /usr/bin/sg_inq not present -- please install sg3_utils" +-- +2.44.0 + diff --git a/sg3_utils.spec b/sg3_utils.spec index 5737944..9897adb 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -4,11 +4,20 @@ Summary: Utilities for devices that use SCSI command sets Name: sg3_utils Version: 1.48 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-2.0-or-later AND BSD-2-Clause URL: https://sg.danny.cz/sg/sg3_utils.html Source0: https://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz Source1: scsi-rescan.8 +# https://github.com/doug-gilbert/sg3_utils/pull/43 +# scripts/rescan-scsi-bus.sh: fix multipath resize without update +Patch0: 0001-rescan-scsi-bus.sh-fix-multipath-resize-without-upda.patch +# https://github.com/doug-gilbert/sg3_utils/pull/44 +# scripts/rescan-scsi-bus.sh: remove /tmp/rescan-scsi-mpath-info.txt +Patch1: 0002-rescan-scsi-bus.sh-remove-tmp-rescan-scsi-mpath-info.patch +# https://github.com/doug-gilbert/sg3_utils/issues/46 +# scripts/rescan-scsi-bus.sh: -r flag unmounts active root disk +Patch2: 0003-rescan-scsi-bus.sh-fix-for-github.com-doug-gilbert-s.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: make @@ -117,6 +126,9 @@ install -p -m 755 scripts/fc_wwpn_id %{buildroot}%{_udevlibdir} %changelog +* Mon Apr 8 2024 Xose Vazquez Perez - 1.48-2 +- fix three bugs in scripts/rescan-scsi-bus.sh from upstream + * Fri Feb 09 2024 Dan HorĂ¡k - 1.48-1 - update to version 1.48 (rhbz#1944444)