From 2ded79587814551f6538c1444c026cdefb392cc6 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 6 Jan 2020 16:51:31 +0100 Subject: [PATCH] * Mon Jan 06 2020 Tomas Bzatek - 1.44-2 - Backport "rescan-scsi-bus.sh: use LUN wildcard in idlist" --- ...si-bus.sh_use_LUN_wildcard_in_idlist.patch | 34 +++++++++++++++++++ sg3_utils.spec | 7 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 sg3_utils-1.45_rescan-scsi-bus.sh_use_LUN_wildcard_in_idlist.patch diff --git a/sg3_utils-1.45_rescan-scsi-bus.sh_use_LUN_wildcard_in_idlist.patch b/sg3_utils-1.45_rescan-scsi-bus.sh_use_LUN_wildcard_in_idlist.patch new file mode 100644 index 0000000..5a4fcf8 --- /dev/null +++ b/sg3_utils-1.45_rescan-scsi-bus.sh_use_LUN_wildcard_in_idlist.patch @@ -0,0 +1,34 @@ +From linux-scsi Thu Oct 25 08:49:11 2018 +From: Martin Wilck +Date: Thu, 25 Oct 2018 08:49:11 +0000 +To: linux-scsi +Subject: [PATCH] rescan-scsi-bus.sh: use LUN wildcard in idlist +Message-Id: <20181025084911.19958-1-mwilck () suse ! com> +X-MARC-Message: https://marc.info/?l=linux-scsi&m=154045737232713 + +By scanning for LUN 0 only, we may encounter a device that the +kernel won't add (e.g. peripheral device type 31) and which may +thus never appear in sysfs for us to use for REPORT LUNS. That +causes LUN additions for such devices to be missed by +"rescan-iscsi-bus.sh -a". + +Signed-off-by: Martin Wilck +--- + scripts/rescan-scsi-bus.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh +index 6989208..a2aa8d8 100755 +--- a/scripts/rescan-scsi-bus.sh ++++ b/scripts/rescan-scsi-bus.sh +@@ -376,7 +376,7 @@ idlist () + + oldlist=$(ls /sys/class/scsi_device/ | sed -n "s/${host}:${channel}:\([0-9]*:[0-9]*\)/\1/p" | uniq) + # Rescan LUN 0 to check if we found new targets +- echo "${channel} - 0" > /sys/class/scsi_host/host${host}/scan ++ echo "${channel} - -" > /sys/class/scsi_host/host${host}/scan + newlist=$(ls /sys/class/scsi_device/ | sed -n "s/${host}:${channel}:\([0-9]*:[0-9]*\)/\1/p" | uniq) + for newid in $newlist ; do + oldid=$newid +-- +2.19.1 diff --git a/sg3_utils.spec b/sg3_utils.spec index 7dd843f..b2a5de7 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -3,7 +3,7 @@ Summary: Utilities for devices that use SCSI command sets Name: sg3_utils Version: 1.44 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and BSD Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz Source2: scsi-rescan.8 @@ -19,6 +19,8 @@ Patch2: sg_raw-version.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1760847 # FC_TARGET_LUN attribute assigned for non FC device Patch3: fc_wwpn_id-non_FC-devices.patch +# backport from svn +Patch4: sg3_utils-1.45_rescan-scsi-bus.sh_use_LUN_wildcard_in_idlist.patch URL: http://sg.danny.cz/sg/sg3_utils.html Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -109,6 +111,9 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev %changelog +* Mon Jan 06 2020 Tomas Bzatek - 1.44-2 +- Backport "rescan-scsi-bus.sh: use LUN wildcard in idlist" + * Fri Jan 03 2020 Tomas Bzatek - 1.44-1 - Rebase to 1.44 release - Enable supplemental udev rules