!10 update package to 1.45

Merge pull request !10 from Markeryang/master
This commit is contained in:
openeuler-ci-bot 2020-07-20 10:51:57 +08:00 committed by Gitee
commit 07b53fe7a2
13 changed files with 152 additions and 418 deletions

View File

@ -1,27 +0,0 @@
From a0569d83929d98c0a175bc3992352c2c8d09ffa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 18 Oct 2013 12:38:05 +0200
Subject: [PATCH] don't open /dev/snapshot in sginfo (#920687)
see https://bugzilla.redhat.com/show_bug.cgi?id=920687 for details
---
src/sginfo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/sginfo.c b/src/sginfo.c
index b27f117..1f2151d 100644
--- a/src/sginfo.c
+++ b/src/sginfo.c
@@ -3408,6 +3408,9 @@ show_devices(int raw)
if ( isdigit(entry->d_name[strlen(entry->d_name)-1]) ) {
continue;
}
+ if ( strncmp("snapshot",entry->d_name,8) == 0 ) {
+ continue;
+ }
snprintf(dev_name, sizeof(dev_name),"/dev/%s",entry->d_name);
--
1.8.1.4

View File

@ -1,10 +1,19 @@
From 03279699ded14ee8c28d21d7009259f79a836d17 Mon Sep 17 00:00:00 2001
From: sunshihao <sunshihao@huawei.com>
Date: Thu, 16 Apr 2020 10:24:51 +0800
Subject: [PATCH 1/4] sg3_utils-1.37-rescan-scsi-findremapped-enhance
---
scripts/rescan-scsi-bus.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 16041ee..74d5683 100755
index 46fe6c0..855cec9 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -734,7 +734,12 @@ findremapped()
@@ -808,7 +808,12 @@ findremapped()
remapped=0
id_serial=`udevadm info -q all -n $sddev | grep "ID_SERIAL=" | cut -d"=" -f2`
id_serial=$(udevadm info -q all -n "$sddev" | grep "ID_SERIAL=" | cut -d"=" -f2)
[ -z "$id_serial" ] && id_serial="none"
- if [ "$id_serial_old" != "$id_serial" ] ; then
+ dm_name=`cat /sys/class/scsi_device/$hctl/device/block/$sddev/holders/*/dm/name 2>/dev/null`
@ -16,3 +25,6 @@ index 16041ee..74d5683 100755
remapped=1
fi
# If udev events updated the disks already, but the multipath device isn't update
--
2.19.1

View File

@ -1,17 +1,26 @@
From faee7759e949f04f4555e9a84e7845d4299d94da Mon Sep 17 00:00:00 2001
From: sunshihao <sunshihao@huawei.com>
Date: Thu, 16 Apr 2020 10:48:26 +0800
Subject: [PATCH 2/4] sg3_utils-1.37-rescan-downpress
---
scripts/rescan-scsi-bus.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 16041ee..e411fd2 100755
index 855cec9..b1cbebc 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -713,6 +713,7 @@ findremapped()
@@ -786,6 +786,7 @@ findremapped()
rm -f $tmpfile
fi
+ echo -n "Triggering udev to update device information... "
# Get all of the ID_SERIAL attributes, after finding their sd node
devs=$(ls /sys/class/scsi_device/)
for hctl in $devs ; do
if [ -d /sys/class/scsi_device/$hctl/device/block ] ; then
@@ -720,12 +721,14 @@ findremapped()
id_serial_old=`udevadm info -q all -n $sddev | grep "ID_SERIAL=" | cut -d"=" -f2`
@@ -794,12 +795,14 @@ findremapped()
id_serial_old=$(udevadm info -q all -n "$sddev" | grep "ID_SERIAL=" | cut -d"=" -f2)
[ -z "$id_serial_old" ] && id_serial_old="none"
echo "$hctl $sddev $id_serial_old" >> $tmpfile
+ udevadm trigger --name-match=$sddev
@ -27,3 +36,6 @@ index 16041ee..e411fd2 100755
udevadm_settle 2>&1 /dev/null
echo "Done"
--
2.19.1

View File

@ -1,132 +0,0 @@
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
index 76773fa..914570b 100644
--- a/lib/sg_pt_linux.c
+++ b/lib/sg_pt_linux.c
@@ -18,8 +18,11 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h> /* to define 'major' */
+#ifndef major
+#include <sys/types.h>
+#endif
#ifdef HAVE_CONFIG_H
diff --git a/src/sg_dd.c b/src/sg_dd.c
index 97a6f77..7bb5eed 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -44,13 +44,15 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/sysmacros.h>
#include <sys/time.h>
#include <sys/file.h>
-#include <linux/major.h>
+#include <sys/sysmacros.h>
+#ifndef major
+#include <sys/types.h>
+#endif
#include <linux/fs.h> /* <sys/mount.h> */
+#include <linux/major.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/src/sg_map26.c b/src/sg_map26.c
index 7739592..8e583d2 100644
--- a/src/sg_map26.c
+++ b/src/sg_map26.c
@@ -33,8 +33,11 @@
#include <dirent.h>
#include <libgen.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h> /* new location for major + minor */
+#ifndef major
+#include <sys/types.h>
+#endif
#include <linux/major.h>
#ifdef HAVE_CONFIG_H
diff --git a/src/sg_read.c b/src/sg_read.c
index 2cf8212..1eb0411 100644
--- a/src/sg_read.c
+++ b/src/sg_read.c
@@ -36,9 +36,11 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
+#ifndef major
+#include <sys/types.h>
+#endif
#include <sys/mman.h>
#include <sys/time.h>
#include <linux/major.h>
diff --git a/src/sg_xcopy.c b/src/sg_xcopy.c
index 11206ac..49b4341 100644
--- a/src/sg_xcopy.c
+++ b/src/sg_xcopy.c
@@ -47,11 +47,13 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/sysmacros.h>
#include <sys/time.h>
#include <sys/file.h>
+#include <sys/sysmacros.h>
+#ifndef major
+#include <sys/types.h>
+#endif
#include <linux/major.h>
#include <linux/fs.h> /* <sys/mount.h> */
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
index 4e40acc..edf4861 100644
--- a/src/sgm_dd.c
+++ b/src/sgm_dd.c
@@ -48,11 +48,13 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/sysmacros.h>
-#include <sys/mman.h>
#include <sys/time.h>
+#include <sys/mman.h>
+#include <sys/sysmacros.h>
+#ifndef major
+#include <sys/types.h>
+#endif
#include <linux/major.h>
#include <linux/fs.h> /* <sys/mount.h> */
diff --git a/src/sgp_dd.c b/src/sgp_dd.c
index 1ebecca..be9547b 100644
--- a/src/sgp_dd.c
+++ b/src/sgp_dd.c
@@ -43,9 +43,11 @@
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
+#ifndef major
+#include <sys/types.h>
+#endif
#include <sys/time.h>
#include <linux/major.h>
#include <linux/fs.h> /* <sys/mount.h> */

View File

@ -0,0 +1,56 @@
From 1d2cf4e2a477646b212b25d6d6be5fee99e20bdb Mon Sep 17 00:00:00 2001
From: sunshihao <sunshihao@huawei.com>
Date: Thu, 16 Apr 2020 10:53:25 +0800
Subject: [PATCH 3/4] bugfix-sg3_utils-fix-syntax-error
---
scripts/rescan-scsi-bus.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index b1cbebc..25a5f2a 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
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
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

View File

@ -0,0 +1,52 @@
From 424d6468d62d09328c19cd54de1132be0940f049 Mon Sep 17 00:00:00 2001
From: sunshihao <sunshihao@huawei.com>
Date: Thu, 16 Apr 2020 11:05:20 +0800
Subject: [PATCH 4/4] sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error
---
scripts/rescan-scsi-bus.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 25a5f2a..dc3026a 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -491,7 +491,7 @@ dolunscan()
# 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 doesn't exist && PQUAL == 0, we mapped a real lun0
- if [ "$lun" -eq 0 ] && [ $IPTYPE -eq 0 ] ; then
+ if [ "x$lun" -eq x0 ] && [ x$IPTYPE -eq 0 ] ; then
if [ $RC = 2 ] ; then
if [ -e "$devpath" ] ; then
if [ -d "$devpath/block" ] ; then
@@ -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
fi
fi
- elif [ $RC = 0 ] && [ $IPTYPE -eq 0 ] ; then
+ elif [ $RC = 0 ] && [ x$IPTYPE -eq x0 ] ; then
if [ -e "$devpath" ] ; then
if [ ! -d "$devpath/block" ] ; then
remappedlun0=1 # Transition from well-known to real lun 0
@@ -512,7 +512,7 @@ dolunscan()
# Special case: lun 0 just got added (for reportlunscan),
# so make sure we correctly treat it as new
- if [ "$lun" = "0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then
+ if [ x"$lun" = x"0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then
SCSISTR=""
printf "\r\e[A\e[A\e[A"
fi
@@ -535,7 +535,7 @@ dolunscan()
sleep 0.02
else
echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
- if [ $RC -eq 1 ] || [ "$lun" -eq 0 ] ; then
+ if [ $RC -eq 1 ] || [ x"$lun" -eq x0 ] ; then
# Try readding, should fail if device is gone
echo "scsi add-single-device $devnr" > /proc/scsi/scsi
fi
--
2.19.1

View File

@ -1,58 +0,0 @@
From eabadd8e6a20252b8ff2f7fde35fd0976a421be8 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Wed, 20 Mar 2019 21:04:34 +0800
Subject: [PATCH] sg3_utils: fix syntax error
reason: when some variable not set, test its value, it will show
"test: =: unary operator expected" error message
---
scripts/rescan-scsi-bus.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 4fa5e6c..9bfd3be 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -85,10 +85,10 @@ findhosts ()
hosts=
for driverdir in /proc/scsi/*; do
driver=${driverdir#/proc/scsi/}
- if test $driver = scsi -o $driver = sg -o $driver = dummy -o $driver = device_info; then continue; fi
+ if test x$driver = xscsi -o x$driver = xsg -o x$driver = xdummy -o x$driver = xdevice_info; then continue; fi
for hostdir in $driverdir/*; do
name=${hostdir#/proc/scsi/*/}
- if test $name = add_map -o $name = map -o $name = mod_parm; then continue; fi
+ if test x$name = xadd_map -o x$name = xmap -o x$name = xmod_parm; then continue; fi
num=$name
driverinfo=$driver
if test -r $hostdir/status; then
@@ -254,7 +254,7 @@ testonline ()
print_and_scroll_back "$host:$channel:$id:$lun $SGDEV ($RMB) "
test $RC = 2 -a "$RMB" = "1" && break
done
- if test $ctr != 0; then white_out; fi
+ if test x$ctr != x0; then white_out; fi
# echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n"
if test $RC = 1; then return $RC; fi
# Reset RC (might be !=0 for passive paths)
@@ -512,7 +512,7 @@ dolunscan()
# Device not present
printf "\r\e[A";
# Optimization: if lun==0, stop here (only if in non-remove mode)
- if test $lun = 0 -a -z "$remove" -a $optscan = 1; then
+ if test x$lun = x0 -a -z "$remove" -a x$optscan = x1; then
break;
fi
else
@@ -1193,7 +1193,7 @@ if [ -d /sys/class/scsi_host -a ! -w /sys/class/scsi_host ]; then
fi
if test "$sync" = 1 -a "$remove" = 1; then sync=2; fi
if test "$sync" = 2; then echo "Syncing file systems"; sync; fi
-if test -w /sys/module/scsi_mod/parameters/default_dev_flags -a $scan_flags != 0; then
+if test -w /sys/module/scsi_mod/parameters/default_dev_flags -a x$scan_flags != x0; then
OLD_SCANFLAGS=`cat /sys/module/scsi_mod/parameters/default_dev_flags`
NEW_SCANFLAGS=$(($OLD_SCANFLAGS|$scan_flags))
if test "$OLD_SCANFLAGS" != "$NEW_SCANFLAGS"; then
--
2.19.1

View File

@ -1,62 +0,0 @@
From 96055f3a30d9643eff5141ed1926468301379c74 Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Fri, 8 Apr 2016 02:46:35 +0000
Subject: [PATCH 016/126] sg_inq: fix potential unbounded loop in --export
git-svn-id: svn://localhost/trunk@691 6180dd3e-e324-4e3e-922d-17de1ae2f315
---
src/sg_inq.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 9dc8838..8aa1970 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -43,7 +43,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.57 20160208"; /* SPC-5 rev 08 */
+static const char * version_str = "1.58 20160407"; /* SPC-5 rev 08 */
/* INQUIRY notes:
* It is recommended that the initial allocation length given to a
@@ -1032,17 +1032,18 @@ static int
encode_whitespaces(unsigned char *str, int inlen)
{
int k, res;
- int j = 0;
- int valid = 0;
+ int j;
+ bool valid = false;
int outlen = inlen, zeroes = 0;
/* Skip initial whitespaces */
- while (isblank(str[j]))
- j++;
- /* Skip possible unicode prefix characters */
- while (str[j] < 0x20)
- j++;
-
+ for (j = 0; (j < inlen) && isblank(str[j]); ++j)
+ ;
+ if (j < inlen) {
+ /* Skip possible unicode prefix characters */
+ for ( ; (j < inlen) && (str[j] < 0x20); ++j)
+ ;
+ }
k = j;
/* Strip trailing whitespaces */
while ((outlen > k) &&
@@ -1069,7 +1070,7 @@ encode_whitespaces(unsigned char *str, int inlen)
zeroes = 0;
} else {
str[res++] = str[k];
- valid++;
+ valid = true;
zeroes = 0;
}
}
--
1.8.3.1

View File

@ -1,66 +0,0 @@
From 48a93dc7dfc8b13f89b0a20ede711de2c54fd0fc Mon Sep 17 00:00:00 2001
From: Doug Gilbert <dgilbert@interlog.com>
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 9bfd3be..8bee514 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -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
+ [ $? -eq 1 ] && break
else
newsearch="$newsearch $tmplun"
fi
@@ -609,6 +611,7 @@ doreportlun()
# Add new ones and check stale ones
for lun in $targetluns $lunremove; do
dolunscan $lun0added
+ [ $? -eq 1 ] && break
done
}
@@ -628,6 +631,7 @@ dosearch ()
else
for lun in $lunsearch; do
dolunscan
+ [ $? -eq 1 ] && break
done
fi
done
--
1.8.3.1

View File

@ -1,52 +0,0 @@
From 56fb49584c56afe1f222b3ee9fc12c7cfd079286 Mon Sep 17 00:00:00 2001
From: wubo <wubo40@huawei.com>
Date: Tue, 27 Aug 2019 14:16:48 +0800
Subject: [PATCH] rescan-scsi-bus.sh fix delete lun report error
---
scripts/rescan-scsi-bus.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 4b23ba4..3f18403 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -434,7 +434,7 @@ dolunscan()
# 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 doesn't exist && PQUAL == 0, we mapped a real lun0
- if test $lun -eq 0 -a $IPTYPE -eq 0 ; then
+ if test x"$lun" = x0 -a x"$IPTYPE" = x0 ; then
if test $RC = 2 ; then
if test -e /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device; then
if test -d /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/block ; then
@@ -443,7 +443,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
fi
fi
- elif test $RC = 0 -a $IPTYPE -eq 0; then
+ elif test $RC = 0 -a x"$IPTYPE" = x0; then
if test -e /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device; then
if test ! -d /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/block ; then
remappedlun0=1 # Transition from well-known to real lun 0
@@ -455,7 +455,7 @@ dolunscan()
# Special case: lun 0 just got added (for reportlunscan),
# so make sure we correctly treat it as new
- if test "$lun" = "0" -a "$1" = "1" -a -z "$remappedlun0"; then
+ if test x"$lun" = x"0" -a "$1" = "1" -a -z "$remappedlun0"; then
SCSISTR=""
printf "\r\e[A\e[A\e[A"
fi
@@ -478,7 +478,7 @@ dolunscan()
sleep 0.02
else
echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
- if test $RC -eq 1 -o $lun -eq 0 ; then
+ if test $RC -eq 1 -o x"$lun" = x0 ; then
# Try readding, should fail if device is gone
echo "scsi add-single-device $devnr" > /proc/scsi/scsi
fi
--
1.8.3.1

Binary file not shown.

BIN
sg3_utils-1.45.tar.xz Normal file

Binary file not shown.

View File

@ -1,22 +1,18 @@
Name: sg3_utils
Version: 1.42
Release: 12
Version: 1.45
Release: 1
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
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
Patch0: 0000-sg3_utils-1.37-dont-open-dev-snapshot.patch
Patch1: 0001-sg3_utils-1.42-sysmacros.patch
Patch2: 0002-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch
Patch3: 0003-sg3_utils-1.37-rescan-downpress.patch
Patch4: 0004-bugfix-sg3_utils-fix-syntax-error.patch
Patch5: 0005-sg_inq-fix-potential-unbounded-loop-in-export.patch
Patch6: 0006-rescan-scsi-bus-dolunscan-break-to-return.patch
Patch7: 0007-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
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
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
Provides: %{name}-libs
Obsoletes: %{name}-libs
BuildRequires: gcc, git
%description
@ -28,7 +24,7 @@ layer or a bridge device are examples of devices that use SCSI command sets.
%package devel
Summary: A collection of tools that send SCSI commands to devices
Requires: %{name}-libs
Obsoletes: %{name}-libs
%description devel
This subpackage contains libraries and header files for developing
@ -74,6 +70,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
%{_mandir}/man8/*
%changelog
* Fri Jul 17 2020 yanglongkang <yanglongkang@huawei.com> - 1.45-1
- update package to 1.45
* Tue Jun 30 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 1.42-12
- renumber patches.