Skip to content

Commit

Permalink
rescan-scsi-bus.sh: remove /tmp/rescan-scsi-mpath-info.txt; https://g…
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-gilbert committed Oct 17, 2023
1 parent 89427a6 commit 593cb07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.

Changelog for pre-release sg3_utils-1.49 [20231016] [svn: r1055]
Changelog for pre-release sg3_utils-1.49 [20231017] [svn: r1056]
- apply https://github.com/doug-gilbert/sg3_utils/pull/39
and its revision [20230807] mainly for Android
- sg_inq: update version descriptors to T10 table 20230814
Expand All @@ -17,6 +17,7 @@ Changelog for pre-release sg3_utils-1.49 [20231016] [svn: r1055]
- sg_get_elem_status: various improvements
- rescan-scsi-bus.sh: fix multipath resize without update
https://github.com/doug-gilbert/sg3_utils/pull/43.diff
and 44.diff
- new error code: SG_LIB_PROGRESS_NOT_READY for long
duration 'in progress' additional sense codes
- lib/sg_pt_solaris.c : fix compilation issue per
Expand Down
16 changes: 12 additions & 4 deletions scripts/rescan-scsi-bus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
VERSION="20230413"
SCAN_WILD_CARD=4294967295

TMPLUNINFOFILE="/tmp/rescan-scsi-mpath-info.txt"
CLEANUP=:
trap 'eval "$CLEANUP"' 0
TMPD=$(mktemp -d /tmp/rsb.XXXXXXXX)
[ "$TMPD" ] || {
echo failed to create temporary directory >&2
exit 1
}
CLEANUP='rm -rf "$TMPD";'"$CLEANUP"

TMPLUNINFOFILE="$TMPD/rescan-scsi-mpath-info.txt"

setcolor ()
{
Expand Down Expand Up @@ -818,9 +827,9 @@ findremapped()
mpaths=""
local tmpfile=

tmpfile=$(mktemp /tmp/rescan-scsi-bus.XXXXXXXX 2> /dev/null)
tmpfile=$(mktemp "$TMPD/rescan-scsi-bus.XXXXXXXX" 2> /dev/null)
if [ -z "$tmpfile" ] ; then
tmpfile="/tmp/rescan-scsi-bus.$$"
tmpfile="$TMPD/rescan-scsi-bus.$$"
rm -f $tmpfile
fi

Expand Down Expand Up @@ -874,7 +883,6 @@ findremapped()
echo "$SCSISTR"
incrchgd "$hctl"
done < $tmpfile
rm -f $tmpfile

if [ -n "$mp_enable" ] && [ -n "$mpaths" ] ; then
echo "Updating multipath device mappings"
Expand Down

0 comments on commit 593cb07

Please sign in to comment.