commit 8280e8e6227eff069455f230fa076f4bb61b41e5 Author: Ryan O'Hara <rohara@redhat.com> Date: Thu Nov 12 16:48:53 2009 -0600 CMAN: scsi_reserve should handle multipath with partitions When using dm-multipath with a LUN has parititions, the dm device's slaves are nested. The script should recongize this scenario and correctly find the device's slaves. Also fixed incorrect variable name and uncommented the 'fence_tool leave' command. rhbz#516625 diff --git a/fence/agents/scsi/scsi_reserve b/fence/agents/scsi/scsi_reserve index f0f5a63..31a1e17 100755 --- a/fence/agents/scsi/scsi_reserve +++ b/fence/agents/scsi/scsi_reserve @@ -108,11 +108,14 @@ do # check if device-mapper device is multipath # - if [[ $dm_uuid =~ "^mpath-*" ]]; then + if [[ $dm_uuid =~ "^mpath" ]]; then dm_devices="$dm_devices $( ls /sys/block/${pv_dev:5}/slaves/ )" + elif [[ $dm_uuid =~ "^part[0-9]-mpath" ]]; then + dm_slave=$( ls /sys/block/${pv_dev:5}/slaves/ ) + dm_devices="$dm_devices $( ls /sys/block/${dm_slave}/slaves/ )" else logger -t scsi_reserve \ - "[error] $dev is not a multipath device" + "[error] $pv_dev is not a multipath device" failure echo exit 1 @@ -223,7 +226,7 @@ case $1 in "[info] $count errors during registration" logger -t scsi_reserve \ "[info] leaving the fence domain" - # fence_tool leave + fence_tool leave failure fi