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 855cec9..b1cbebc 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -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
@@ -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
+      sleep 0.01
     fi
   done
 
   # Trigger udev to update the info
-  echo -n "Triggering udev to update device information... "
-  /sbin/udevadm trigger
+  #echo -n "Triggering udev to update device information... "
+  #/sbin/udevadm trigger
   udevadm_settle 2>&1 /dev/null
   echo "Done"
 
-- 
2.19.1

