Compare commits
10 Commits
793de20d8f
...
073b260104
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
073b260104 | ||
|
|
848c35bda2 | ||
|
|
a2dd8ae19f | ||
|
|
157a8fd9ca | ||
|
|
745ad2bc68 | ||
|
|
83bbc7abae | ||
|
|
2769707d2b | ||
|
|
6528f6170b | ||
|
|
c844ccf131 | ||
|
|
5f0708042b |
@ -3,54 +3,33 @@ From: sunshihao <sunshihao@huawei.com>
|
||||
Date: Thu, 16 Apr 2020 10:53:25 +0800
|
||||
Subject: [PATCH 3/4] bugfix-sg3_utils-fix-syntax-error
|
||||
|
||||
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||
---
|
||||
scripts/rescan-scsi-bus.sh | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
scripts/rescan-scsi-bus.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
|
||||
index b1cbebc..25a5f2a 100755
|
||||
index b1cbebc..5f867c4 100755
|
||||
--- a/scripts/rescan-scsi-bus.sh
|
||||
+++ b/scripts/rescan-scsi-bus.sh
|
||||
@@ -83,10 +83,10 @@ findhosts ()
|
||||
hosts=
|
||||
for driverdir in /proc/scsi/*; do
|
||||
driver=${driverdir#/proc/scsi/}
|
||||
- if [ "$driver" = scsi ] || [ "$driver" = sg ] || [ "$driver" = dummy ] || [ "$driver" = device_info ] ; then continue; fi
|
||||
+ if [ "$driver" = xscsi ] || [ "$driver" = xsg ] || [ "$driver" = xdummy ] || [ "$driver" = xdevice_info ] ; then continue; fi
|
||||
for hostdir in $driverdir/*; do
|
||||
name=${hostdir#/proc/scsi/*/}
|
||||
- if [ "$name" = add_map ] || [ "$name" = map ] || [ "$name" = mod_parm ] ; then continue; fi
|
||||
+ if [ "$name" = xadd_map ] || [ "$name" = xmap ] || [ "$name" = xmod_parm ] ; then continue; fi
|
||||
num=$name
|
||||
driverinfo=$driver
|
||||
if [ -r "$hostdir/status" ] ; then
|
||||
@@ -289,7 +289,7 @@ testonline ()
|
||||
print_and_scroll_back "$host:$channel:$id:$lun $SGDEV ($RMB) "
|
||||
[ $RC = 2 ] && [ "$RMB" = "1" ] && break
|
||||
done
|
||||
- if [ $ctr != 0 ] ; then
|
||||
+ if [ $xctr != x0 ] ; then
|
||||
+ if [ "$ctr" != 0 ] ; then
|
||||
white_out
|
||||
fi
|
||||
# echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n"
|
||||
@@ -569,7 +569,7 @@ dolunscan()
|
||||
# Device not present
|
||||
printf "\r\e[A";
|
||||
# Optimization: if lun==0, stop here (only if in non-remove mode)
|
||||
- if [ "$lun" = 0 ] && [ -z "$remove" ] && [ "$optscan" = 1 ] ; then
|
||||
+ if [ x"$lun" = x0 ] && [ -z "$remove" ] && [ "x$optscan" = x1 ] ; then
|
||||
return 1;
|
||||
fi
|
||||
else
|
||||
@@ -1283,7 +1283,7 @@ if [ "$sync" = 2 ] ; then
|
||||
echo "Syncing file systems"
|
||||
sync
|
||||
fi
|
||||
-if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ $scan_flags != 0 ] ; then
|
||||
+if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ x$scan_flags != x0 ] ; then
|
||||
+if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ "$scan_flags" != 0 ] ; then
|
||||
OLD_SCANFLAGS=$(cat /sys/module/scsi_mod/parameters/default_dev_flags)
|
||||
NEW_SCANFLAGS=$((OLD_SCANFLAGS|scan_flags))
|
||||
if [ "$OLD_SCANFLAGS" != "$NEW_SCANFLAGS" ] ; then
|
||||
--
|
||||
2.19.1
|
||||
2.35.3
|
||||
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
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
|
||||
|
||||
63
0004-sg_ses-fix-crash-when-m-LEN-252.patch
Normal file
63
0004-sg_ses-fix-crash-when-m-LEN-252.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From bfbefdf2d9aa12107d08d796d6fc78862ab85402 Mon Sep 17 00:00:00 2001
|
||||
From: Douglas Gilbert <dgilbert@interlog.com>
|
||||
Date: Sun, 1 Aug 2021 03:14:05 +0000
|
||||
Subject: [PATCH] sg_ses: fix crash when 'm LEN' < 252
|
||||
|
||||
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@907 6180dd3e-e324-4e3e-922d-17de1ae2f315
|
||||
|
||||
fix issue:https://gitee.com/src-openeuler/sg3_utils/issues/I5G05L
|
||||
|
||||
memset enc_stat_rsp by its true length
|
||||
|
||||
Signed-off-by: wangxiaomeng <wangxiaomeng@kylinos.cn>
|
||||
---
|
||||
src/sg_ses.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/sg_ses.c b/src/sg_ses.c
|
||||
index b9ac2e4..701359b 100644
|
||||
--- a/src/sg_ses.c
|
||||
+++ b/src/sg_ses.c
|
||||
@@ -5530,7 +5530,7 @@ int
|
||||
main(int argc, char * argv[])
|
||||
{
|
||||
bool have_cgs = false;
|
||||
- int k, d_len, res, resid, vb;
|
||||
+ int k, n, d_len, res, resid, vb;
|
||||
int sg_fd = -1;
|
||||
int pd_type = 0;
|
||||
int ret = 0;
|
||||
@@ -5764,15 +5764,17 @@ main(int argc, char * argv[])
|
||||
}
|
||||
}
|
||||
clear_scsi_pt_obj(ptvp);
|
||||
- memset(enc_stat_rsp, 0, 4096);
|
||||
+ memset(enc_stat_rsp, 0, enc_stat_rsp_sz);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ptvp) {
|
||||
- ret = sg_ll_request_sense_pt(ptvp, false, enc_stat_rsp,
|
||||
- REQUEST_SENSE_RESP_SZ, ! op->quiet, vb);
|
||||
+ n = (enc_stat_rsp_sz < REQUEST_SENSE_RESP_SZ) ? enc_stat_rsp_sz :
|
||||
+ REQUEST_SENSE_RESP_SZ;
|
||||
+ ret = sg_ll_request_sense_pt(ptvp, false, enc_stat_rsp, n,
|
||||
+ ! op->quiet, vb);
|
||||
if (0 == ret) {
|
||||
- int sense_len = REQUEST_SENSE_RESP_SZ - get_scsi_pt_resid(ptvp);
|
||||
+ int sense_len = n - get_scsi_pt_resid(ptvp);
|
||||
struct sg_scsi_sense_hdr ssh;
|
||||
|
||||
if ((sense_len > 7) && sg_scsi_normalize_sense(enc_stat_rsp,
|
||||
@@ -5801,7 +5803,7 @@ main(int argc, char * argv[])
|
||||
" problems ahead\n", ret);
|
||||
}
|
||||
clear_scsi_pt_obj(ptvp);
|
||||
- memset(enc_stat_rsp, 0, REQUEST_SENSE_RESP_SZ);
|
||||
+ memset(enc_stat_rsp, 0, enc_stat_rsp_sz);
|
||||
}
|
||||
|
||||
if (op->nickname_str)
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
From 4ea97e60c544ad44ee7396c815064d87f0d25874 Mon Sep 17 00:00:00 2001
|
||||
From: Douglas Gilbert <dgilbert@interlog.com>
|
||||
Date: Sun, 7 Aug 2022 02:49:03 +0000
|
||||
Subject: [PATCH] rescan-scsi-bus: sgdevice26: do not traverse sg class if
|
||||
scsi_device isnot added
|
||||
|
||||
For system which has a massive number of scsi_devices, it would takes a long time to
|
||||
traverse /sys/class/scsi_generic to find a related sg. If the scsi_device of specific
|
||||
scsiid host:channel:target:lun did not added, the traverse would find no sg neither.
|
||||
|
||||
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||
|
||||
From: https://github.com/doug-gilbert/sg3_utils/pull/21
|
||||
|
||||
|
||||
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@965 6180dd3e-e324-4e3e-922d-17de1ae2f315
|
||||
---
|
||||
scripts/rescan-scsi-bus.sh | 19 +++++++++++--------
|
||||
1 file changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
|
||||
index 0c33384..f3e3b2c 100755
|
||||
--- a/scripts/rescan-scsi-bus.sh
|
||||
+++ b/scripts/rescan-scsi-bus.sh
|
||||
@@ -184,18 +184,21 @@ sgdevice26 ()
|
||||
{
|
||||
local gendev
|
||||
|
||||
+ # if the scsi device has not been added, then there would not
|
||||
+ # a related sgdev. So it's pointless to scan all sgs to find
|
||||
+ # a related sg.
|
||||
+ scsidev=/sys/class/scsi_device/${host}:${channel}:${id}:${lun}
|
||||
+ if [ ! -e "$scsidev" ]; then
|
||||
+ SGDEV=""
|
||||
+ return
|
||||
+ fi
|
||||
+
|
||||
gendev=/sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/generic
|
||||
if [ -e "$gendev" ] ; then
|
||||
SGDEV=$(basename "$(readlink "$gendev")")
|
||||
- else
|
||||
- for SGDEV in /sys/class/scsi_generic/sg*; do
|
||||
- DEV=$(readlink "$SGDEV/device")
|
||||
- if [ "${DEV##*/}" = "$host:$channel:$id:$lun" ] ; then
|
||||
- SGDEV=$(basename "$SGDEV"); return
|
||||
- fi
|
||||
- done
|
||||
- SGDEV=""
|
||||
+ return
|
||||
fi
|
||||
+ SGDEV=""
|
||||
}
|
||||
|
||||
# Find sg device with 2.4 report-devs extensions
|
||||
--
|
||||
2.27.0
|
||||
|
||||
62
0008-rescan-scsi-bus.sh-add-option-no-lip-scan.patch
Normal file
62
0008-rescan-scsi-bus.sh-add-option-no-lip-scan.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From b109bf4c5bacf65d32d2ab4fb990efb5230fda27 Mon Sep 17 00:00:00 2001
|
||||
From: Douglas Gilbert <dgilbert@interlog.com>
|
||||
Date: Fri, 12 Aug 2022 02:55:43 +0000
|
||||
Subject: [PATCH] rescan-scsi-bus.sh: add option --no-lip-scan
|
||||
|
||||
lip is a FC operation and can be used to rescan device but it can not
|
||||
specify the channel and target. So add a new option to scan FC hosts
|
||||
according to the SCSI general interface in sysfs:
|
||||
/sys/class/scsi_host/hostX/scan.
|
||||
|
||||
The default value of no_lip_scan is 0 which does not change the
|
||||
default behavior.
|
||||
|
||||
Fix https://github.com/doug-gilbert/sg3_utils/issues/20
|
||||
|
||||
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||
|
||||
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@967 6180dd3e-e324-4e3e-922d-17de1ae2f315
|
||||
---
|
||||
scripts/rescan-scsi-bus.sh | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
|
||||
index 31ae736..67dccf3 100755
|
||||
--- a/scripts/rescan-scsi-bus.sh
|
||||
+++ b/scripts/rescan-scsi-bus.sh
|
||||
@@ -1158,6 +1158,7 @@ if [ "@$1" = @--help ] || [ "@$1" = @-h ] || [ "@$1" = "@-?" ] ; then
|
||||
echo "--largelun: Tell kernel to support LUNs > 7 even on SCSI2 devs"
|
||||
echo "--luns=LIST: Scan only lun(s) in LIST"
|
||||
echo "--multipath: same as -m"
|
||||
+ echo "--no-lip-scan: don't scan FC Host with issue-lip"
|
||||
echo "--nooptscan: don't stop looking for LUNs if 0 is not found"
|
||||
echo "--remove: same as -r"
|
||||
echo "--reportlun2: Tell kernel to try REPORT_LUN even on SCSI2 devices"
|
||||
@@ -1226,6 +1227,7 @@ mp_enable=
|
||||
lipreset=-1
|
||||
declare -i scan_flags=0
|
||||
ignore_rev=0
|
||||
+no_lip_scan=0
|
||||
|
||||
# Scan options
|
||||
opt="$1"
|
||||
@@ -1260,6 +1262,7 @@ while [ ! -z "$opt" ] && [ -z "${opt##-*}" ] ; do
|
||||
-largelun) scan_flags=$((scan_flags|0x200)) ;;
|
||||
-luns=*) arg=${opt#-luns=}; lunsearch=$(expandlist "$arg") ;;
|
||||
-multipath) mp_enable=1 ;;
|
||||
+ -no-lip-scan) no_lip_scan=1 ;;
|
||||
-nooptscan) optscan=0 ;;
|
||||
-nosync) sync=0 ;;
|
||||
-remove) remove=1 ;;
|
||||
@@ -1337,7 +1340,7 @@ elif [ $resize -eq 1 ] ; then
|
||||
else
|
||||
for host in $hosts; do
|
||||
echo -n "Scanning host $host "
|
||||
- if [ -e "/sys/class/fc_host/host$host" ] ; then
|
||||
+ if [ $no_lip_scan -eq 0 ] && [ -e "/sys/class/fc_host/host$host" ] ; then
|
||||
# It's pointless to do a target scan on FC
|
||||
issue_lip=/sys/class/fc_host/host$host/issue_lip
|
||||
if [ -e "$issue_lip" ] && [ "$lipreset" -ge 0 ] ; then
|
||||
--
|
||||
2.27.0
|
||||
|
||||
33
0009-rescan-scsi-bus.sh-speed-testonline.patch
Normal file
33
0009-rescan-scsi-bus.sh-speed-testonline.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From e680e840140d19cb3419ff92595bc2c91de3368a Mon Sep 17 00:00:00 2001
|
||||
From: Douglas Gilbert <dgilbert@interlog.com>
|
||||
Date: Mon, 26 Sep 2022 21:41:45 +0000
|
||||
Subject: [PATCH 1/2] rescan-scsi-bus.sh speed testonline()
|
||||
|
||||
speed testonline() function when
|
||||
peripheral_qualifier != 0 in the standard INQUIRY
|
||||
response. See:
|
||||
https://github.com/doug-gilbert/sg3_utils/issues/24
|
||||
|
||||
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@972 6180dd3e-e324-4e3e-922d-17de1ae2f315
|
||||
|
||||
Conflict: Reserve changes about rescan-scsi-bus only
|
||||
---
|
||||
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 67dccf3..0e7697b 100755
|
||||
--- a/scripts/rescan-scsi-bus.sh
|
||||
+++ b/scripts/rescan-scsi-bus.sh
|
||||
@@ -276,7 +276,7 @@ testonline ()
|
||||
|
||||
# Handle in progress of becoming ready and unit attention
|
||||
while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le 30 ] ; do
|
||||
- if [ $RC = 2 ] && [ "$RMB" != "1" ] ; then
|
||||
+ if [ $RC = 2 ] && [ "$RMB" != "1" ] && [ sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ] ; then
|
||||
echo -n "."
|
||||
let LN+=1
|
||||
sleep 1
|
||||
--
|
||||
2.35.3
|
||||
|
||||
130
0010-rescan-scsi-bus-speed-large-multipath-scans.patch
Normal file
130
0010-rescan-scsi-bus-speed-large-multipath-scans.patch
Normal file
@ -0,0 +1,130 @@
|
||||
From fe62f3e9ce96927bf9bcfb19b33447b54aafdc1f Mon Sep 17 00:00:00 2001
|
||||
From: Douglas Gilbert <dgilbert@interlog.com>
|
||||
Date: Fri, 30 Sep 2022 08:58:39 +0000
|
||||
Subject: [PATCH 2/2] rescan-scsi-bus: speed large multipath scans
|
||||
|
||||
Speed multipath scans with many LUNs by caching multipath
|
||||
LUN info in temporary file, see:
|
||||
https://github.com/doug-gilbert/sg3_utils/issues/22
|
||||
Fix small bug in last commit, see:
|
||||
https://github.com/doug-gilbert/sg3_utils/issues/24
|
||||
|
||||
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@973 6180dd3e-e324-4e3e-922d-17de1ae2f315
|
||||
|
||||
Conflict: reserve changes about rescan-scsi-bus only
|
||||
---
|
||||
scripts/rescan-scsi-bus.sh | 57 ++++++++++++++++++++++++++------------
|
||||
1 file changed, 40 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
|
||||
index 0e7697b..7508dba 100755
|
||||
--- a/scripts/rescan-scsi-bus.sh
|
||||
+++ b/scripts/rescan-scsi-bus.sh
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
VERSION="20180615"
|
||||
SCAN_WILD_CARD=4294967295
|
||||
+TMPLUNINFOFILE="/tmp/rescan-scsi-mpath-info.txt"
|
||||
|
||||
setcolor ()
|
||||
{
|
||||
@@ -276,7 +277,7 @@ testonline ()
|
||||
|
||||
# Handle in progress of becoming ready and unit attention
|
||||
while [ $RC = 2 -o $RC = 6 ] && [ $ctr -le 30 ] ; do
|
||||
- if [ $RC = 2 ] && [ "$RMB" != "1" ] && [ sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ] ; then
|
||||
+ if [ $RC = 2 ] && [ "$RMB" != "1" ] && sg_inq /dev/$SGDEV | grep -q -i "PQual=0" ; then
|
||||
echo -n "."
|
||||
let LN+=1
|
||||
sleep 1
|
||||
@@ -777,6 +778,33 @@ searchexisting()
|
||||
done
|
||||
}
|
||||
|
||||
+getallmultipathinfo()
|
||||
+{
|
||||
+ local mp=
|
||||
+ local uuid=
|
||||
+ local dmtmp=
|
||||
+ local maj_min=
|
||||
+ local tmpfile=
|
||||
+
|
||||
+ truncate -s 0 $TMPLUNINFOFILE
|
||||
+ for mp in $($DMSETUP ls --target=multipath | cut -f 1) ; do
|
||||
+ [ "$mp" = "No" ] && break;
|
||||
+ maj_min=$($DMSETUP status "$mp" | cut -d " " -f14)
|
||||
+ if [ ! -L /dev/mapper/${mp} ]; then
|
||||
+ echo "softlink /dev/mapper/${mp} not available."
|
||||
+ continue
|
||||
+ fi
|
||||
+ local ret=$(readlink /dev/mapper/$mp 2>/dev/null)
|
||||
+ if [[ $? -ne 0 || -z "$ret" ]]; then
|
||||
+ echo "readlink /dev/mapper/$mp failed. check multipath status."
|
||||
+ continue
|
||||
+ fi
|
||||
+ dmtmp=$(basename $ret)
|
||||
+ uuid=$(cut -f2 -d- "/sys/block/$dmtmp/dm/uuid")
|
||||
+ echo "$mp $maj_min $dmtmp $uuid" >> $TMPLUNINFOFILE
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
# Go through all of the existing devices and figure out any that have been remapped
|
||||
findremapped()
|
||||
{
|
||||
@@ -815,6 +843,8 @@ findremapped()
|
||||
udevadm_settle 2>&1 /dev/null
|
||||
echo "Done"
|
||||
|
||||
+ getallmultipathinfo
|
||||
+
|
||||
# See what changed and reload the respective multipath device if applicable
|
||||
while read -r hctl sddev id_serial_old ; do
|
||||
remapped=0
|
||||
@@ -945,7 +975,6 @@ findmultipath()
|
||||
local dev="$1"
|
||||
local find_mismatch="$2"
|
||||
local mp=
|
||||
- local mp2=
|
||||
local found_dup=0
|
||||
local maj_min=
|
||||
|
||||
@@ -955,27 +984,21 @@ findmultipath()
|
||||
fi
|
||||
|
||||
maj_min=$(cat "/sys/block/$dev/dev")
|
||||
- for mp in $($DMSETUP ls --target=multipath | cut -f 1) ; do
|
||||
- [ "$mp" = "No" ] && break;
|
||||
- if "$DMSETUP" status "$mp" | grep -q " $maj_min "; then
|
||||
- # With two arguments, look up current uuid from sysfs
|
||||
- # if it doesn't match what was passed, this multipath
|
||||
- # device is not updated, so this is a remapped LUN
|
||||
- if [ -n "$find_mismatch" ] ; then
|
||||
- mp2=$($MULTIPATH -l "$mp" | egrep -o "dm-[0-9]+")
|
||||
- mp2=$(cut -f2 -d- "/sys/block/$mp2/dm/uuid")
|
||||
- if [ "$find_mismatch" != "$mp2" ] ; then
|
||||
- addmpathtolist "$mp"
|
||||
- found_dup=1
|
||||
- fi
|
||||
- continue
|
||||
+ mp=$(cat $TMPLUNINFOFILE | grep -w "$maj_min" | cut -d " " -f1)
|
||||
+ if [ -n "$mp" ]; then
|
||||
+ if [ -n "$find_mismatch" ] ; then
|
||||
+ uuid=$(cat $TMPLUNINFOFILE | grep -w "$maj_min" | cut -d " " -f4)
|
||||
+ if [ "$find_mismatch" != "$uuid" ] ; then
|
||||
+ addmpathtolist "$mp"
|
||||
+ found_dup=1
|
||||
fi
|
||||
+ else
|
||||
# Normal mode: Find the first multipath with the sdev
|
||||
# and add it to the list
|
||||
addmpathtolist "$mp"
|
||||
return
|
||||
fi
|
||||
- done
|
||||
+ fi
|
||||
|
||||
# Return 1 to signal that a duplicate was found to the calling function
|
||||
if [ $found_dup -eq 1 ] ; then
|
||||
--
|
||||
2.35.3
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: sg3_utils
|
||||
Version: 1.46
|
||||
Release: 4
|
||||
Release: 8
|
||||
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
|
||||
@ -10,9 +10,13 @@ Patch0: 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch
|
||||
Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch
|
||||
Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch
|
||||
Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
|
||||
Patch4: 0004-sg3_utils-fix-memset-coredump.patch
|
||||
Patch4: 0004-sg_ses-fix-crash-when-m-LEN-252.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
|
||||
Patch7: 0007-rescan-scsi-bus-sgdevice26-do-not-traverse-sg-class-.patch
|
||||
Patch8: 0008-rescan-scsi-bus.sh-add-option-no-lip-scan.patch
|
||||
Patch9: 0009-rescan-scsi-bus.sh-speed-testonline.patch
|
||||
Patch10:0010-rescan-scsi-bus-speed-large-multipath-scans.patch
|
||||
|
||||
Provides: %{name}-libs
|
||||
Obsoletes: %{name}-libs
|
||||
@ -76,6 +80,18 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%changelog
|
||||
* Fri Nov 4 2022 volcanodragon <linfeilong@huawei.com> - 1.46-8
|
||||
- backport speed multipath scan patches from mainline
|
||||
|
||||
* Fri Sep 2 2022 Wenchao Hao <haowenchao@huawei.com> - 1.46-7
|
||||
- backport rescan-scsi-bus patches from mainline
|
||||
|
||||
* 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
|
||||
- Fix grammar error in rescan-scsi-bus.sh introduced by patch
|
||||
|
||||
* Thu Feb 17 2022 Wenchao Hao <haowenchao@huawei.com> -1.46-4
|
||||
- Fix grammar error in rescan-scsi-bus.sh
|
||||
|
||||
@ -97,11 +113,11 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
|
||||
* Sat Jul 31 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.45-4
|
||||
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
|
||||
|
||||
* Wed Nov 10 2020 haowenchao <haowenchao@huawei.com> - 1.45-3
|
||||
* Tue Nov 10 2020 haowenchao <haowenchao@huawei.com> - 1.45-3
|
||||
- Fix grammar problems caused by patch
|
||||
0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
|
||||
|
||||
* Wed Nov 5 2020 lixiaokeng <lixiaokeng@huawei.com> - 1.45-2
|
||||
* Thu Nov 5 2020 lixiaokeng <lixiaokeng@huawei.com> - 1.45-2
|
||||
- add make check
|
||||
|
||||
* Fri Jul 17 2020 yanglongkang <yanglongkang@huawei.com> - 1.45-1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user