From a767ab8de3e1f5cf579f6ccf62f0fc3d803fe57a Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Fri, 13 Mar 2020 19:14:30 +0800 Subject: [PATCH] rescan-scsi-bus dolunscan modify break to return --- ...n-scsi-bus-dolunscan-break-to-return.patch | 46 +++++++++++++++++-- 9004-break-to-return.patch | 21 --------- ...ete-lun-rescan-scsi-bus-report-error.patch | 0 sg3_utils.spec | 15 ++++-- 4 files changed, 52 insertions(+), 30 deletions(-) rename 9005-for-dolunscan.patch => 0002-rescan-scsi-bus-dolunscan-break-to-return.patch (30%) delete mode 100644 9004-break-to-return.patch rename 9006-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch => 9004-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch (100%) diff --git a/9005-for-dolunscan.patch b/0002-rescan-scsi-bus-dolunscan-break-to-return.patch similarity index 30% rename from 9005-for-dolunscan.patch rename to 0002-rescan-scsi-bus-dolunscan-break-to-return.patch index 76d90d0..67e1dcb 100644 --- a/9005-for-dolunscan.patch +++ b/0002-rescan-scsi-bus-dolunscan-break-to-return.patch @@ -1,8 +1,43 @@ +From 48a93dc7dfc8b13f89b0a20ede711de2c54fd0fc Mon Sep 17 00:00:00 2001 +From: Doug Gilbert +Date: Fri, 13 Mar 2020 18:43:57 +0800 +Subject: [PATCH] rescan-scsi-bus-dolunscan-break-to-return + +--- + scripts/rescan-scsi-bus.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh -index 417dd1d..4b23ba4 100755 +index 9bfd3be..8bee514 100755 --- a/scripts/rescan-scsi-bus.sh +++ b/scripts/rescan-scsi-bus.sh -@@ -594,6 +594,7 @@ doreportlun() +@@ -494,7 +494,7 @@ dolunscan() + if test -z "$SCSISTR" -a $RC != 1 -a "$remappedlun0" != "1"; then + printf "\r${red}DEL: $norm\r\n\n" + # In the event we're replacing with a well known node, we need to let it continue, to create the replacement node +- test "$remappedlun0" != "2" && return 1 ++ test "$remappedlun0" != "2" && return 2 + fi + fi + if test -z "$SCSISTR" -o -n "$remappedlun0"; then +@@ -513,7 +513,7 @@ dolunscan() + printf "\r\e[A"; + # Optimization: if lun==0, stop here (only if in non-remove mode) + if test x$lun = x0 -a -z "$remove" -a x$optscan = x1; then +- break; ++ return 1; + fi + else + if test "$remappedlun0" != "2" ; then +@@ -521,6 +521,7 @@ dolunscan() + fi + fi + fi ++ return 0; + } + + # Perform report lun scan on $host $channel $id using REPORT_LUNS +@@ -593,6 +594,7 @@ doreportlun() if test $tmplun -eq $lun ; then inlist=1 dolunscan $lun0added @@ -10,7 +45,7 @@ index 417dd1d..4b23ba4 100755 else newsearch="$newsearch $tmplun" fi -@@ -610,6 +611,7 @@ doreportlun() +@@ -609,6 +611,7 @@ doreportlun() # Add new ones and check stale ones for lun in $targetluns $lunremove; do dolunscan $lun0added @@ -18,7 +53,7 @@ index 417dd1d..4b23ba4 100755 done } -@@ -629,6 +631,7 @@ dosearch () +@@ -628,6 +631,7 @@ dosearch () else for lun in $lunsearch; do dolunscan @@ -26,3 +61,6 @@ index 417dd1d..4b23ba4 100755 done fi done +-- +1.8.3.1 + diff --git a/9004-break-to-return.patch b/9004-break-to-return.patch deleted file mode 100644 index b8d06ec..0000000 --- a/9004-break-to-return.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh -index 9bfd3be..417dd1d 100755 ---- a/scripts/rescan-scsi-bus.sh -+++ b/scripts/rescan-scsi-bus.sh -@@ -513,7 +513,7 @@ dolunscan() - printf "\r\e[A"; - # Optimization: if lun==0, stop here (only if in non-remove mode) - if test x$lun = x0 -a -z "$remove" -a x$optscan = x1; then -- break; -+ return 1; - fi - else - if test "$remappedlun0" != "2" ; then -@@ -521,6 +521,7 @@ dolunscan() - fi - fi - fi -+ return 0; - } - - # Perform report lun scan on $host $channel $id using REPORT_LUNS diff --git a/9006-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch b/9004-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch similarity index 100% rename from 9006-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch rename to 9004-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch diff --git a/sg3_utils.spec b/sg3_utils.spec index 0b545a5..e7142bd 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.42 -Release: 9 +Release: 10 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -13,9 +13,8 @@ Patch9000: 9000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch Patch9001: 9001-sg3_utils-1.37-rescan-downpress.patch Patch9002: 9002-bugfix-sg3_utils-fix-syntax-error.patch Patch9003: 9003-sg_inq-fix-potential-unbounded-loop-in-export.patch -Patch9004: 9004-break-to-return.patch -Patch9005: 9005-for-dolunscan.patch -Patch9006: 9006-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch +Patch0002: 0002-rescan-scsi-bus-dolunscan-break-to-return.patch +Patch9004: 9004-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch Provides: %{name}-libs Obsoletes: %{name}-libs @@ -76,6 +75,12 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Fri Mar 13 2020 wubo - 1.42-10 +- Type:enhancemnet +- ID:NA +- SUG:restart +- DESCi: modify rescan-scsi-bus dolunscan break to return + * Tue Sep 24 2019 wubo - 1.42-9 - Type:enhancemnet - ID:NA @@ -91,7 +96,7 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la * Wed Aug 21 2019 wubo - 1.42-6.7 - change patch name -* Mon Jul 18 2019 wangye - 1.42-6.6 +* Thu Jul 18 2019 wangye - 1.42-6.6 - Type:bugfix - ID:NA - SUG:NA -- Gitee