diff --git a/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch b/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch new file mode 100644 index 0000000..e22c628 --- /dev/null +++ b/SOURCES/BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch @@ -0,0 +1,14 @@ +diff -Nur sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh sg3_utils-1.37/scripts/rescan-scsi-bus.sh +--- sg3_utils-1.37_old/scripts/rescan-scsi-bus.sh 2017-03-14 14:45:43.312032787 +0800 ++++ sg3_utils-1.37/scripts/rescan-scsi-bus.sh 2017-03-14 14:47:06.997039234 +0800 +@@ -964,8 +964,8 @@ + echo "--issue-lip: same as -i" + echo "--wide: same as -w" + echo "--multipath: same as -m" +- echo "--forcerescan: Rescan existing devices" +- echo "--forceremove: Remove and readd every device (DANGEROUS)" ++ echo "--forceremove: Remove stale devices (DANGEROUS)" ++ echo "--forcerescan: Remove and readd existing devices (DANGEROUS)" + echo "--nooptscan: don't stop looking for LUNs if 0 is not found" + echo "--color: use coloured prefixes OLD/NEW/DEL" + echo "--hosts=LIST: Scan only host(s) in LIST" diff --git a/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch b/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch new file mode 100644 index 0000000..7c2927c --- /dev/null +++ b/SOURCES/BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch @@ -0,0 +1,45 @@ +From c387f9de93750a04380f068803ce9da340cf45f5 Mon Sep 17 00:00:00 2001 +From: Sebastian Parschauer +Date: Wed, 31 Aug 2016 15:34:23 +0200 +Subject: [PATCH] rescan-scsi-bus.sh: Add lunsearch filter to searchexisting() + +A user has reported that `rescan-scsi-bus.sh --luns=` prints +all existing LUNs and scans all new LUNs instead of only the ones +specified. The problem is that searchexisting() always calls +doreportlun() and is missing the lunsearch filter e.g. used in +dosearch(). +So add the required lunsearch filter from dosearch() to +searchexisting(). + +References: bsc#981452 + +Signed-off-by: Sebastian Parschauer +--- + scripts/rescan-scsi-bus.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 5f43d6d..1f957b0 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -715,7 +715,16 @@ searchexisting() + else + match=1 + fi +- test $match -eq 1 && doreportlun ++ ++ test $match -eq 0 && continue ++ ++ if [ -z "$lunsearch" ] ; then ++ doreportlun ++ else ++ for lun in $lunsearch ; do ++ dolunscan ++ done ++ fi + done + } + +-- +2.12.0 + diff --git a/SOURCES/rescan-scsi-bus.sh.8 b/SOURCES/rescan-scsi-bus.sh.8 index 9576574..60f8feb 100644 --- a/SOURCES/rescan-scsi-bus.sh.8 +++ b/SOURCES/rescan-scsi-bus.sh.8 @@ -44,10 +44,10 @@ look for existing disks that have been remapped look for resized disks and reload associated multipath devices, if applicable .TP \fB\-\-forcerescan\fR -rescan existing devices +remove and readd existing devices (DANGEROUS) .TP \fB\-\-forceremove\fR -remove and readd every device (DANGEROUS) +remove stale devices (DANGEROUS) .TP \fB\-\-nooptscan\fR don't stop looking for LUNs if 0 is not found diff --git a/SPECS/sg3_utils.spec b/SPECS/sg3_utils.spec index 67955a2..eb17e93 100644 --- a/SPECS/sg3_utils.spec +++ b/SPECS/sg3_utils.spec @@ -3,7 +3,7 @@ Summary: Utilities for devices that use SCSI command sets Name: sg3_utils Version: 1.37 -Release: 9%{?dist} +Release: 12%{?dist} License: GPLv2+ and BSD Group: Applications/System Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tgz @@ -22,6 +22,8 @@ Patch6: sg_rdac_additional_upstream_fixes.patch Patch7: sg3_utils-1.37-rescan-scsi-typo.patch #document -m/--multipath option in rescan-scsi-bus.sh script (#1357851) Patch8: sg3_utils-1.37-rescan-scsi-missingoption.patch +Patch9: BZ_1380744-rescan-scsi-bus.sh-Add-lunsearch-filter-to-searchexi.patch +Patch10: BZ_1360915-rescan-scsi-bus.sh-Fixup-help-text-for-forcerescan.patch URL: http://sg.danny.cz/sg/sg3_utils.html Requires: %{name}-libs = %{version}-%{release} @@ -68,6 +70,8 @@ developing applications. %patch6 -p1 -b .upstream2 %patch7 -p1 -b .typo %patch8 -p1 -b .missingopt +%patch9 -p1 -b .rescan_all_lun +%patch10 -p1 -b .help_forcerescan_forceremove %build %configure --disable-static @@ -110,6 +114,17 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8 %changelog +* Wed May 10 2017 Gris Ge 1.37-12 +- Fix the manpage of `forceremove` and `forcerescan` command. + (RHBZ #1360915) + +* Tue Mar 14 2017 Gris Ge - 1.37-11 +- Fix the help message of `forceremove` and `forcerescan` command. + (RHBZ #1360915) + +* Tue Mar 07 2017 Gris Ge - 1.37-10 +- Fix rescan-scsi-bus.sh for scan all luns. (RHBZ #1380744) + * Tue Jul 19 2016 Ondrej Vasik - 1.37-9 - rescan-scsi-bus.sh: document -m/--multipath option (#1357851)