Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 146264 Details for
Bug 212265
lvm'd multipath'd iscsi luns don't shutdown properly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch against iscsi init script that incorporates improvements in multipath and lvm device flushing on stopping iscsi
linux-iscsi-4.0.3.0-improve-iscsi-shutdown-with-dm-devices.patch (text/plain), 5.00 KB, created by
Dave Wysochanski
on 2007-01-23 01:03:03 UTC
(
hide
)
Description:
Patch against iscsi init script that incorporates improvements in multipath and lvm device flushing on stopping iscsi
Filename:
MIME Type:
Creator:
Dave Wysochanski
Created:
2007-01-23 01:03:03 UTC
Size:
5.00 KB
patch
obsolete
>--- /etc/init.d/iscsi.orig 2007-01-16 17:27:02.000000000 -0500 >+++ /etc/init.d/iscsi 2007-01-22 19:26:19.000000000 -0500 >@@ -23,6 +23,101 @@ CONNFAILTIMEOUT=${CONNFAILTIMEOUT:-30} > ABORTTIMEOUT=${ABORTTIMEOUT:-10} > RESETTIMEOUT=${RESETTIMEOUT:-30} > >+ >+ >+ >+# >+# Description: Determine whether passed in device is an iscsi or is part of >+# a dm device that has an iscsi device at a leaf node in the >+# dm tree >+# >+# Parameters: >+# $1 - device in question, in the following format: "major:minor" >+# >+# Return Values: >+# 1 - is an iSCSI device, or is part of dm map that has iscsi devices >+# 0 - not an iSCSI device, and not part of a dm map with iscsi devices >+# >+is_iscsi_map() >+{ >+ dev=$1 >+ # >+ # First, check to see if this is a dm-device. If it is, we need >+ # to go through the tree to a leaf node >+ # >+ major=`echo $1 | awk -F ":" '{ print $1 }'` >+ minor=`echo $1 | awk -F ":" '{ print $2 }'` >+ dmcmd=`dmsetup deps -j $major -m $minor >& /dev/null` >+ # >+ # FIXME: Catch potential infinite recursion >+ # >+ # one danger here would be infinite recursion if, for some reason, >+ # the above dmsetup cmd would always return success... >+ # For this reason, we might want to consider a max depth variable >+ # or some other infinite recursion technique >+ # >+ if [ $? -eq 0 ]; then >+ # dm device >+ # dependencies line looks like this: >+ # # dmsetup deps iscsi--vg0-iscsi--stripe--lv0 >+ # 3 dependencies : (253, 2) (253, 3) (253, 4) >+ deps=`dmsetup deps -j $major -m $minor | perl -ne 'if (/^\d+\s*dependencies\s*:\s*(.*)/) { $x = $1; $x =~ tr/[(,)]/[ , ]/; $x =~ s/,\s+/:/g; print $x; }'` >+ for dep in $deps; do >+ # need recursion here >+ is_iscsi_map $dep >+ if [ $? -eq 1 ]; then >+ return 1 >+ fi >+ done >+ # if we get here, then we know we are not an iscsi device or dm >+ # device with iscsi dependencies >+ return 0 >+ fi >+ >+ # >+ # Ok, leaf node, so check to see if it's iscsi >+ # >+ # FIXME: inefficient since we're going through all sd's >+ # Might be some fancy way we could use grep to do one compare... >+ # >+ this_special=`cat /proc/partitions | grep -E "^[ \t]+$major[ \t]+$minor[ \t]+" | awk '{ print $4 }'` >+ for dev_sd in $iscsi_dev_sds; do >+ if [ "$this_special" == "$dev_sd" ]; then >+ return 1; >+ fi >+ done >+ >+ # no match found >+ return 0 >+} >+ >+ >+# >+# Description: Find the iSCSI-based LVs and deactivate them. An iSCSI based >+# LV is one which any iSCSI device is at the bottom of the dm >+# device tree for that device. >+# >+# FIXME: Won't work with snapshots - need to filter these out and only deactivate >+# origins >+# >+# FIXME: Won't work with more complex mappings (mirror on linear) >+# >+deactivate_iscsi_lvs() >+{ >+ lvpaths=`lvs --noheadings -ovg_name,lv_name 2>/dev/null | awk '{ print $1 "/" $2 }'` >+ for onelv in $lvpaths; do >+ onedev=`lvs --noheadings -okernel_major,kernel_minor $onelv 2>/dev/null | awk '{ print $1 ":" $2 }'` >+ is_iscsi_map $onedev >+ if [ $? -eq 1 ]; then >+ echo "$onelv iSCSI based LV, deactivating" >+ lvchange -an $onelv >+ else >+ echo "$onelv not iSCSI based LV, not deactivating" >+ fi >+ done >+} >+ >+ > # Flush iscsi dm device maps > > # we put this here temporarily. In U5 or later we can move to a script >@@ -32,29 +127,20 @@ declare -a iscsi_mpaths > list_dms() > { > i=0 >- dev_sds=`iscsi-ls -l | grep Device | awk '{print $2}'| sed -e "s%/dev/%%"` > dev_mpaths=`dmsetup table | grep multipath | awk '{print $1}' | sed -e "s/://"` > > echo "Searching for iscsi-based multipath maps" >- for dev_sd in $dev_sds; do >- for dev_mpath in $dev_mpaths; do >- # check to see if "cat /sys/block/$dev_sd/dev" matches "dmsetup table", and if so, save the "mpathN" device >- major_minor=`cat /sys/block/$dev_sd/dev` >- dmsetup_mpath=`dmsetup table $dev_mpath | grep -c $major_minor` >- if [ $dmsetup_mpath -eq 1 ]; then >- found=0 >- for ((j=0; j<$i ; j++)) >- do >- if [ ${iscsi_mpaths[$j]} = $dev_mpath ]; then >- found=1 >- fi >- done >- if [ $found -ne 1 ]; then >- iscsi_mpaths[$i]=$dev_mpath >- let "i += 1" >- fi >- fi >- done >+ for dev_mpath in $dev_mpaths; do >+ #echo "Checking map $dev_mpath" >+ # check to see if "cat /sys/block/$dev_sd/dev" >+ # is an iscsi-based device map, and if so, save >+ # the "mpathN" device >+ major_minor=`dmsetup info $dev_mpath | grep "^Major, minor" | awk '{ print $3 ":" $4 }' | tr -d ","` >+ is_iscsi_map $major_minor >+ if [ $? -eq 1 ]; then >+ iscsi_mpaths[$i]=$dev_mpath >+ let "i += 1" >+ fi > done > echo "Found" $i "maps" > } >@@ -331,9 +417,21 @@ stop() > { > ret=0 > >+ # >+ # Put this operation here so we only do it 1x. >+ # The reason is that "iscsi-ls -l" is expensive (calls scsi_id >+ # to get inquiry data) >+ # >+ iscsi_dev_sds="`iscsi-ls -l | grep Device | awk '{print $2}'| sed -e 's%/dev/%%'`" >+ >+ # First, deactivate any LV's >+ deactivate_iscsi_lvs >+ >+ # Now, flush multipath devices > list_dms > flush_iscsi_dms > >+ # Now we can shut down the protocol > echo -n "Stopping iscsid: " > if ! pidofproc iscsid > /dev/null 2>&1; then > echo -n "iscsid not running"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212265
:
139412
|
139417
|
139418
|
139480
|
145748
|
145749
|
146233
|
146264
|
146457
|
411163
|
411399