From patchwork Mon Aug 23 22:06:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 125711 Received: from mx02.colomx.prod.int.phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7O2buF7032455 for ; Tue, 24 Aug 2010 02:38:43 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx02.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7NM7I9T004002; Mon, 23 Aug 2010 18:07:19 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7NM7Gni016104 for ; Mon, 23 Aug 2010 18:07:16 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7NM7BAb016671 for ; Mon, 23 Aug 2010 18:07:11 -0400 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id o7NM6xwC011445 for ; Mon, 23 Aug 2010 18:07:02 -0400 Received: (qmail 26163 invoked by uid 9475); 23 Aug 2010 22:06:59 -0000 Date: 23 Aug 2010 22:06:59 -0000 Message-ID: <20100823220659.26161.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools/multipath mpath_wait multipath ... X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 24 Aug 2010 02:39:13 +0000 (UTC) --- multipath-tools/multipath/mpath_wait 2006/10/06 16:38:01 1.1 +++ multipath-tools/multipath/mpath_wait 2010/08/23 22:06:58 1.1.2.1 @@ -3,6 +3,18 @@ retry=3 sec=1 +if [ $# -eq 1 ] +then + while [ ! -e $1 -a "$retry" -gt 0 ] + do + retry=$(($retry - 1)) + sleep $sec + done + [ -e $1 ] + ret=$? + exit $ret +fi + /sbin/dmsetup info -c --noheadings -j $1 -m $2 2> /dev/null | grep -q .*:${1}:${2}:L.*:.*:.*:.*:.* ret=$? --- multipath-tools/multipath/multipath.rules 2009/09/29 17:52:27 1.11.2.2 +++ multipath-tools/multipath/multipath.rules 2010/08/23 22:06:58 1.11.2.3 @@ -6,7 +6,7 @@ PROGRAM!="/sbin/mpath_wait %M %m", GOTO="end_mpath" PROGRAM!="/sbin/dmsetup info -c --noheadings -j %M -m %m", GOTO="end_mpath" RESULT!="*:*:*:*:*:*:*:mpath-*", GOTO="kpartx_check" -PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/sbin/kpartx -a -p p /dev/mapper/%c" +PROGRAM=="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", RESULT=="?*", NAME="%k", SYMLINK="mpath/%c", RUN+="/bin/bash -c '/sbin/mpath_wait /dev/mapper/%c; /sbin/kpartx -a -p p /dev/mapper/%c'" OPTIONS="last_rule" LABEL="kpartx_check" RESULT!="*:*:*:*:*:*:*:part*-mpath-*", GOTO="end_mpath"