1 Star 0 Fork 15

wangzhiqiang / sg3_utils

forked from src-openEuler / sg3_utils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
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" = x0 ] && [ x$IPTYPE = x0 ] ; 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 = 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" ] && [ x"$1" = x"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" = x0 ] ; then
# Try readding, should fail if device is gone
echo "scsi add-single-device $devnr" > /proc/scsi/scsi
fi
--
2.19.1
1
https://gitee.com/foolstrong/sg3_utils.git
git@gitee.com:foolstrong/sg3_utils.git
foolstrong
sg3_utils
sg3_utils
master

搜索帮助