sg3_utils/add-lunsearch-filter-to-searchexisting.patch
2016-09-08 09:50:27 +00:00

45 lines
1.2 KiB
Diff

From: Sebastian Parschauer <sparschauer@suse.de>
Date: Wed, 31 Aug 2016 15:34:23 +0200
Subject: [PATCH] rescan-scsi-bus.sh: Add lunsearch filter to searchexisting()
References: bnc#981452
Patch-Mainline: not yet, sent but waiting for upstream response
A user has reported that `rescan-scsi-bus.sh --luns=<lun #>` prints
all existing LUNs and scans all new LUNs instead of only the ones
specified. The problem is that searchexisting() always calls
doreportlun() and is missing the lunsearch filter e.g. used in
dosearch().
So add the required lunsearch filter from dosearch() to
searchexisting().
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
---
scripts/rescan-scsi-bus.sh | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index fad4868..5bc4a95 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -711,7 +711,16 @@ searchexisting()
else
match=1
fi
- test $match -eq 1 && doreportlun
+
+ test $match -eq 0 && continue
+
+ if [ -z "$lunsearch" ] ; then
+ doreportlun
+ else
+ for lun in $lunsearch ; do
+ dolunscan
+ done
+ fi
done
}
--
2.6.6