Skip to contentSkip to conversation

multipath-tools/multipath Makefile multipath.r ...

PATCH [email protected] 1 participant 1 message Oct 6, 2006 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Changes by: [email protected] 2006-10-06 16:38:01

Modified files:
multipath : Makefile multipath.rules
Added files:
multipath : mpath_wait
Removed files:
multipath : kpartx_get_name mpath_get_name

Log message:
Fixed another part of bz 207772. All that's left is for the dm kernel fix to go in, and everything should be fine.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/mpath_wait.diff?cvsroot=dm&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/Makefile.diff?cvsroot=dm&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/multipath.rules.diff?cvsroot=dm&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/kpartx_get_name.diff?cvsroot=dm&r1=1.1&r2=NONE
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/mpath_get_name.diff?cvsroot=dm&r1=1.1&r2=NONE

/cvs/dm/multipath-tools/multipath/mpath_wait,v --> standard output revision 1.1

- renamed from multipath/mpath_wait +17 -0
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+retry=3
+sec=1
+
+/sbin/dmsetup info -c --noheadings -j $1 -m $2 2> /dev/null | grep -q .*:${1}:${2}:L.*:.*:.*:.*:.*
+ret=$?
+
+while [ "$ret" -ne 0 -a "$retry" -gt 0 ]
+do
+        sleep $sec
+        /sbin/dmsetup info -c --noheadings -j $1 -m $2 2> /dev/null | grep -q .*:${1}:${2}:L.*:.*:.*:.*:.*
+        ret=$?
+        retry=$(($retry - 1))
+done
+
+exit $ret
multipath/Makefile +1 -2
@@ -48,8 +48,7 @@
 	rm $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
 	rm $(DESTDIR)$(bindir)/$(EXEC)
 	rm $(DESTDIR)$(bindir)/$(EXEC).static
-	rm $(DESTDIR)$(bindir)/mpath_get_name
-	rm $(DESTDIR)$(bindir)/kpartx_get_name
+	rm $(DESTDIR)$(bindir)/mpath_wait
 	rm $(DESTDIR)$(mandir)/$(EXEC).8
 
 clean:
multipath/multipath.rules +1 -0
@@ -3,6 +3,7 @@
 SUBSYSTEM!="block", GOTO="end_mpath"
 KERNEL!="dm-[0-9]*", ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/lsmod | /bin/grep ^dm_multipath'", RUN+="/sbin/multipath -v0 %M:%m"
 KERNEL!="dm-[0-9]*", GOTO="end_mpath"
+PROGRAM!="/sbin/mpath_wait %M %m", GOTO="end_mpath"
 ACTION=="add", RUN+="/sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -a' -j %M -m %m"
 PROGRAM=="/sbin/dmsetup ls --target multipath --exec /bin/basename -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", OPTIONS="last_rule"
 PROGRAM!="/bin/bash -c '/sbin/dmsetup info -c --noheadings -j %M -m %m | /bin/grep -q .*:.*:.*:.*:.*:.*:.*:part[0-9]*-mpath-'", GOTO="end_mpath"