Compare commits

..

No commits in common. "9074e8d8bcdc86de446ebd62342d5bcb2b15786c" and "c23b1608938a779ce65a471c67c3d33461638621" have entirely different histories.

7 changed files with 86 additions and 27 deletions

View File

@ -11,7 +11,7 @@ diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 25a5f2a..dc3026a 100755 index 25a5f2a..dc3026a 100755
--- a/scripts/rescan-scsi-bus.sh --- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh +++ b/scripts/rescan-scsi-bus.sh
@@ -502,7 +502,7 @@ dolunscan() @@ -491,7 +491,7 @@ dolunscan()
# Well known lun transition case. Only for Direct-Access devs (type 0) # Well known lun transition case. Only for Direct-Access devs (type 0)
# If block directory exists && and PQUAL != 0, we unmapped lun0 and just have a well-known lun # If block directory exists && and PQUAL != 0, we unmapped lun0 and just have a well-known lun
# If block directory doesn't exist && PQUAL == 0, we mapped a real lun0 # If block directory doesn't exist && PQUAL == 0, we mapped a real lun0
@ -20,7 +20,7 @@ index 25a5f2a..dc3026a 100755
if [ $RC = 2 ] ; then if [ $RC = 2 ] ; then
if [ -e "$devpath" ] ; then if [ -e "$devpath" ] ; then
if [ -d "$devpath/block" ] ; then if [ -d "$devpath/block" ] ; then
@@ -511,7 +511,7 @@ dolunscan() @@ -500,7 +500,7 @@ dolunscan()
RC=0 # Set this so the system leaves the existing well known lun alone. This is a lun 0 with no block directory RC=0 # Set this so the system leaves the existing well known lun alone. This is a lun 0 with no block directory
fi fi
fi fi
@ -29,7 +29,7 @@ index 25a5f2a..dc3026a 100755
if [ -e "$devpath" ] ; then if [ -e "$devpath" ] ; then
if [ ! -d "$devpath/block" ] ; then if [ ! -d "$devpath/block" ] ; then
remappedlun0=1 # Transition from well-known to real lun 0 remappedlun0=1 # Transition from well-known to real lun 0
@@ -523,7 +523,7 @@ dolunscan() @@ -512,7 +512,7 @@ dolunscan()
# Special case: lun 0 just got added (for reportlunscan), # Special case: lun 0 just got added (for reportlunscan),
# so make sure we correctly treat it as new # so make sure we correctly treat it as new
@ -38,13 +38,13 @@ index 25a5f2a..dc3026a 100755
SCSISTR="" SCSISTR=""
printf "\r\e[A\e[A\e[A" printf "\r\e[A\e[A\e[A"
fi fi
@@ -546,7 +546,7 @@ dolunscan() @@ -535,7 +535,7 @@ dolunscan()
sleep 0.02 sleep 0.02
else else
echo "scsi remove-single-device $devnr" > /proc/scsi/scsi echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
- if [ $RC -eq 1 ] || [ "$lun" -eq 0 ] ; then - if [ $RC -eq 1 ] || [ "$lun" -eq 0 ] ; then
+ if [ $RC -eq 1 ] || [ x"$lun" = x0 ] ; then + if [ $RC -eq 1 ] || [ x"$lun" = x0 ] ; then
# Try reading, should fail if device is gone # Try readding, should fail if device is gone
echo "scsi add-single-device $devnr" > /proc/scsi/scsi echo "scsi add-single-device $devnr" > /proc/scsi/scsi
fi fi
-- --

View File

@ -0,0 +1,29 @@
From dd2a61c9551ac5d2ac0c5902172fd8312edc22cb Mon Sep 17 00:00:00 2001
From: yanglongkang <yanglongkang@huawei.com>
Date: Tue, 9 Feb 2021 11:39:32 +0800
Subject: [PATCH] sg3_utils: fix memset coredump
alloc MX_ALLOC_LEN size mem to enc_stat_rsp for
solving coredump problem.
Signed-off-by: yanglongkang <yanglongkang@huawei.com>
---
src/sg_ses.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 23fc3b9..cf344b7 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -5582,7 +5582,7 @@ main(int argc, char * argv[])
enumerate_work(op);
goto early_out;
}
- enc_stat_rsp = sg_memalign(op->maxlen, 0, &free_enc_stat_rsp, false);
+ enc_stat_rsp = sg_memalign(MX_ALLOC_LEN, 0, &free_enc_stat_rsp, false);
if (NULL == enc_stat_rsp) {
pr2serr("Unable to get heap for enc_stat_rsp\n");
goto err_out;
--
1.8.3.1

View File

@ -0,0 +1,43 @@
From fc72119f67614152d635452856ec9894474599e4 Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Mon, 3 Jan 2022 17:49:24 +0000
Subject: [PATCH] rescan-scsi-bus.sh: apply fix for '-r' from
https://github.com/doug-gilbert/sg3_utils/pull/10/ from Nitin U. Yewale,
broken by rev 867
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@929 6180dd3e-e324-4e3e-922d-17de1ae2f315
Conflict: only keep rescan-scsi-bus's changes, change of following files
are removed:
BSD_LICENSE
CREDITS
ChangeLog
debian/changelog
doc/rescan-scsi-bus.sh.8
doc/sg3_utils.8
sg3_utils.spec
---
scripts/rescan-scsi-bus.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 16a7642..57fbe66 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -307,7 +307,13 @@ testonline ()
IPREV=$(echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/')
STR=$(printf " Vendor: %-08s Model: %-16s Rev: %-4s" "$IVEND" "$IPROD" "$IPREV")
IPTYPE=$(echo "$INQ" | sed -n 's/.* Device_type=\([0-9]*\) .*/\1/p')
+ if [ -z "$IPTYPE" ]; then
+ IPTYPE=$(echo "$INQ" | sed -n 's/.* PDT=\([0-9]*\) .*/\1/p')
+ fi
IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) Device.*/\1/p')
+ if [ -z "$IPQUAL" ] ; then
+ IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) PDT.*/\1/p')
+ fi
if [ "$IPQUAL" != 0 ] ; then
[ -z "$IPQUAL" ] && IPQUAL=3
[ -z "$IPTYPE" ] && IPTYPE=31
--
2.34.1

BIN
sg3_utils-1.46.tar.xz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: sg3_utils Name: sg3_utils
Version: 1.48 Version: 1.46
Release: 1 Release: 5
Summary: Utilities that send SCSI commands to devices. Summary: Utilities that send SCSI commands to devices.
License: GPL-2.0-or-later AND BSD License: GPL-2.0-or-later AND BSD
URL: http://sg.danny.cz/sg/sg3_utils.html URL: http://sg.danny.cz/sg/sg3_utils.html
@ -10,7 +10,9 @@ Patch0: 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch
Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch
Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch
Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
Patch4: 0004-sg3_utils-rescan-scsi-bus-list-all-LUNs-in-one-line.patch Patch4: 0004-sg3_utils-fix-memset-coredump.patch
Patch5: 0005-sg3_utils-rescan-scsi-bus-list-all-LUNs-in-one-line.patch
Patch6: 0006-rescan-scsi-bus.sh-apply-fix-for-r-from-https-github.patch
Provides: %{name}-libs Provides: %{name}-libs
Obsoletes: %{name}-libs Obsoletes: %{name}-libs
@ -74,21 +76,6 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
%{_mandir}/man8/* %{_mandir}/man8/*
%changelog %changelog
* Fri Oct 27 2023 Paul Thomas <paulthomas100199@gmail.com> - 1.48-1
- update to version 1.48
* Thu Nov 3 2022 volcanodragon <linfeilong@huawei.com> - 1.47-3
- backport speed multipath scan patches from mainline
* Fri Sep 2 2022 Wenchao Hao <haowenchao@huawei.com> - 1.47-2
- backport rescan-scsi-bus patches from mainline
* Sat Aug 13 2022 volcanodragon <linfeilong@huawei.com> - 1.47-1
- update version to 1.47
* Mon Jul 11 2022 wangxiaomeng <wangxiaomeng@kylinos.cn> - 1.46-6
- Backport patch to solve coredump problem, fix crash when 'm LEN' < 252
* Fri Jul 1 2022 Wenchao Hao <haowenchao@huawei.com> -1.46-5 * Fri Jul 1 2022 Wenchao Hao <haowenchao@huawei.com> -1.46-5
- Fix grammar error in rescan-scsi-bus.sh introduced by patch - Fix grammar error in rescan-scsi-bus.sh introduced by patch