From patchwork Fri Jul 27 20:57:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 1250741 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork1.kernel.org (Postfix) with ESMTP id 146E13FC5A for ; Fri, 27 Jul 2012 21:04:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6RL2QsP013243; Fri, 27 Jul 2012 17:02:26 -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 q6RKvPS4032299 for ; Fri, 27 Jul 2012 16:57:25 -0400 Received: from ether.msp.redhat.com (ether.msp.redhat.com [10.15.80.119]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6RKvJ8v020878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jul 2012 16:57:19 -0400 Received: from ether.msp.redhat.com (localhost.localdomain [127.0.0.1]) by ether.msp.redhat.com (8.14.1/8.14.1) with ESMTP id q6RKvIis020849; Fri, 27 Jul 2012 15:57:18 -0500 Received: (from bmarzins@localhost) by ether.msp.redhat.com (8.14.1/8.14.1/Submit) id q6RKvIdX020848; Fri, 27 Jul 2012 15:57:18 -0500 Date: Fri, 27 Jul 2012 15:57:18 -0500 From: Benjamin Marzinski To: device-mapper development Message-ID: <20120727205718.GL5299@ether.msp.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH][RESEND] multipath: fix cciss device names 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: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com When we're looking for cciss devices in sysfs, they have a "!" not a "/". If users run multipath on a cciss device using it's devnode name, /dev/cciss/cXdY, multipath should convert that to the sysfs name. Signed-off-by: Benjamin Marzinski --- multipath/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: multipath-tools-120518/multipath/main.c =================================================================== --- multipath-tools-120518.orig/multipath/main.c +++ multipath-tools-120518/multipath/main.c @@ -409,6 +409,16 @@ get_dev_type(char *dev) { return DEV_DEVMAP; } +static void +convert_dev(char *dev) +{ + char *ptr = strstr(dev, "cciss/"); + if (ptr) { + ptr += 5; + *ptr = '!'; + } +} + int main (int argc, char *argv[]) { @@ -514,6 +524,8 @@ main (int argc, char *argv[]) strncpy(conf->dev, argv[optind], FILE_NAME_SIZE); conf->dev_type = get_dev_type(conf->dev); + if (conf->dev_type == DEV_DEVNODE) + convert_dev(conf->dev); } conf->daemon = 0;