[dm-devel] multipath-tools/multipath kpartx_get_name mpat ...

bmarzins at sourceware.org bmarzins at sourceware.org
Tue May 25 22:51:48 UTC 2010


CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL4_FC5
Changes by:	bmarzins at sourceware.org	2010-05-25 22:51:43

Modified files:
	multipath      : kpartx_get_name mpath_get_name multipath.dev 

Log message:
	Mark Goodwin's patch to avoid running dm ls --exec <program>, to avoid the
	race between multipath and dmsetup creating the device nodes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/kpartx_get_name.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/mpath_get_name.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/multipath.dev.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.13.2.1&r2=1.13.2.2

--- multipath-tools/multipath/Attic/kpartx_get_name	2006/05/12 22:17:13	1.1
+++ multipath-tools/multipath/Attic/kpartx_get_name	2010/05/25 22:51:42	1.1.2.1
@@ -25,7 +25,8 @@
 	exit 1
 fi
 
-i=`/sbin/dmsetup ls --target linear --exec basename -j $1 -m $2 2> /dev/null`
+dev=`/sbin/dmsetup ls --target linear -j $1 -m $2 | sed -e 's/([ 0-9]*,[ 0-9]*)//g' 2>/dev/null`
+i=`basename $dev 2>/dev/null`
 
 if [ -n "$i" ] ; then
 	echo $i
--- multipath-tools/multipath/Attic/mpath_get_name	2006/05/12 22:17:13	1.1
+++ multipath-tools/multipath/Attic/mpath_get_name	2010/05/25 22:51:42	1.1.2.1
@@ -19,7 +19,8 @@
 	exit 1
 fi
 
-i=`/sbin/dmsetup ls --target multipath --exec basename -j $1 -m $2 2> /dev/null`
+dev=`/sbin/dmsetup ls --target multipath -j $1 -m $2 | sed -e 's/([ 0-9]*,[ 0-9]*)//g' 2>/dev/null`
+i=`basename $dev 2>/dev/null`
 
 if [ -n "$i" ] ; then
 	echo $i
--- multipath-tools/multipath/Attic/multipath.dev	2006/06/28 19:29:10	1.13.2.1
+++ multipath-tools/multipath/Attic/multipath.dev	2010/05/25 22:51:42	1.13.2.2
@@ -29,5 +29,8 @@
 
 if [ "${DEVPATH:7:3}" = "dm-" -a "${ACTION}" = "add" ]; then
 	majmin=`awk -F ':' '{ print "-j",$1,"-m",$2 }' /sys/${DEVPATH}/dev`
-	/sbin/dmsetup ls ${majmin} --target multipath --exec "/sbin/kpartx -a"
+	devnames=`/sbin/dmsetup ls ${majmin} --target multipath | sed -e 's/([ 0-9]*,[ 0-9]*)//g'`
+	for dev in $devnames; do
+		[ -n "$dev" ] && /sbin/kpartx -a /dev/mapper/$dev
+	done
 fi




More information about the dm-devel mailing list