From patchwork Tue May 25 22:51:48 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: 102305 Received: from mx02.colomx.prod.int.phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4PMsTH4019346 for ; Tue, 25 May 2010 22:55:04 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 o4PMqHlt029209; Tue, 25 May 2010 18:52:19 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PMqBlU012740 for ; Tue, 25 May 2010 18:52:11 -0400 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PMq1Tx032455 for ; Tue, 25 May 2010 18:52:01 -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 o4PMpmtn008725 for ; Tue, 25 May 2010 18:51:48 -0400 Received: (qmail 27226 invoked by uid 9475); 25 May 2010 22:51:48 -0000 Date: 25 May 2010 22:51:48 -0000 Message-ID: <20100525225148.27224.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.12 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.11 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools/multipath kpartx_get_name mpat ... 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, 25 May 2010 22:55:04 +0000 (UTC) --- 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