|
|
c896fb |
---
|
|
|
c896fb |
multipath/mpathconf | 37 ++++++++++++++++++++++++++-----------
|
|
|
c896fb |
1 file changed, 26 insertions(+), 11 deletions(-)
|
|
|
c896fb |
|
|
|
c896fb |
Index: multipath-tools-130222/multipath/mpathconf
|
|
|
c896fb |
===================================================================
|
|
|
c896fb |
--- multipath-tools-130222.orig/multipath/mpathconf
|
|
|
c896fb |
+++ multipath-tools-130222/multipath/mpathconf
|
|
|
c896fb |
@@ -42,6 +42,19 @@ function usage
|
|
|
c896fb |
echo ""
|
|
|
c896fb |
}
|
|
|
c896fb |
|
|
|
c896fb |
+function add_wwid
|
|
|
c896fb |
+{
|
|
|
c896fb |
+ INDEX=0
|
|
|
c896fb |
+ while [ "$INDEX" -lt "$WWIDS" ] ; do
|
|
|
c896fb |
+ if [ "$1" = "${WWID_LIST[$INDEX]}" ] ; then
|
|
|
c896fb |
+ return
|
|
|
c896fb |
+ fi
|
|
|
c896fb |
+ ((INDEX++))
|
|
|
c896fb |
+ done
|
|
|
c896fb |
+ WWID_LIST[$WWIDS]="$1"
|
|
|
c896fb |
+ ((WWIDS++))
|
|
|
c896fb |
+}
|
|
|
c896fb |
+
|
|
|
c896fb |
function get_dm_deps
|
|
|
c896fb |
{
|
|
|
c896fb |
shift 3
|
|
|
c896fb |
@@ -59,11 +72,9 @@ function get_dm_deps
|
|
|
c896fb |
function set_dm_wwid
|
|
|
c896fb |
{
|
|
|
c896fb |
if [[ "$1" =~ ^part[[:digit:]]+-mpath- ]] ; then
|
|
|
c896fb |
- WWID_LIST[$WWIDS]="${1##part*-mpath-}"
|
|
|
c896fb |
- ((WWIDS++))
|
|
|
c896fb |
+ add_wwid "${1##part*-mpath-}"
|
|
|
c896fb |
elif [[ "$1" =~ ^mpath- ]] ; then
|
|
|
c896fb |
- WWID_LIST[$WWIDS]="${1##mpath-}"
|
|
|
c896fb |
- ((WWIDS++))
|
|
|
c896fb |
+ add_wwid "${1##mpath-}"
|
|
|
c896fb |
else
|
|
|
c896fb |
get_dm_deps `dmsetup deps -u $1`
|
|
|
c896fb |
fi
|
|
|
c896fb |
@@ -82,8 +93,7 @@ function set_wwid
|
|
|
c896fb |
if [ -n "$UUID" ] ; then
|
|
|
c896fb |
set_dm_wwid $UUID
|
|
|
c896fb |
else
|
|
|
c896fb |
- WWID_LIST[$WWIDS]="$1"
|
|
|
c896fb |
- ((WWIDS++))
|
|
|
c896fb |
+ add_wwid "$1"
|
|
|
c896fb |
fi
|
|
|
c896fb |
}
|
|
|
c896fb |
|
|
|
c896fb |
@@ -198,13 +208,13 @@ function validate_args
|
|
|
c896fb |
|
|
|
c896fb |
function add_blacklist_exceptions
|
|
|
c896fb |
{
|
|
|
c896fb |
- echo "blacklist_exceptions {" >> $TMPFILE
|
|
|
c896fb |
INDEX=0
|
|
|
c896fb |
while [ "$INDEX" -lt "$WWIDS" ] ; do
|
|
|
c896fb |
- echo " wwid \"${WWID_LIST[$INDEX]}\"" >> $TMPFILE
|
|
|
c896fb |
+ sed -i '/^blacklist_exceptions[[:space:]]*{/ a\
|
|
|
c896fb |
+ wwid '"\"${WWID_LIST[$INDEX]}\""'
|
|
|
c896fb |
+' $TMPFILE
|
|
|
c896fb |
((INDEX++))
|
|
|
c896fb |
done
|
|
|
c896fb |
- echo "}" >> $TMPFILE
|
|
|
c896fb |
}
|
|
|
c896fb |
|
|
|
c896fb |
umask 0077
|
|
|
c896fb |
@@ -350,9 +360,14 @@ if [ "$ENABLE" = 2 ]; then
|
|
|
c896fb |
sed -i '/^blacklist[[:space:]]*{/,/^}/ s/^[[:space:]]*#[[:space:]]*wwid \"\.\?\*\"/ wwid ".*"/' $TMPFILE
|
|
|
c896fb |
fi
|
|
|
c896fb |
if [ "$HAVE_EXCEPTIONS" = 1 ]; then
|
|
|
c896fb |
- sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/d' $TMPFILE
|
|
|
c896fb |
+ sed -i '/^blacklist_exceptions[[:space:]]*{/,/^}/ {/^[[:space:]]*wwid/ d}' $TMPFILE
|
|
|
c896fb |
+ else
|
|
|
c896fb |
+ cat >> $TMPFILE <<- _EOF_
|
|
|
c896fb |
+
|
|
|
c896fb |
+blacklist_exceptions {
|
|
|
c896fb |
+}
|
|
|
c896fb |
+_EOF_
|
|
|
c896fb |
fi
|
|
|
c896fb |
- echo $HAVE_WWID_DISABLE
|
|
|
c896fb |
add_blacklist_exceptions
|
|
|
c896fb |
elif [ "$ENABLE" = 1 ]; then
|
|
|
c896fb |
if [ "$HAVE_DISABLE" = 1 ]; then
|