From patchwork Tue Aug 24 21:51:11 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: 127631 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 o7OLqadZ004504 for ; Tue, 24 Aug 2010 21:53:12 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 o7OLpRx2004740; Tue, 24 Aug 2010 17:51:30 -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 o7OLpQpf014966 for ; Tue, 24 Aug 2010 17:51:26 -0400 Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.9]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7OLpLTf008841 for ; Tue, 24 Aug 2010 17:51:21 -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 o7OLpBg4008111 for ; Tue, 24 Aug 2010 17:51:11 -0400 Received: (qmail 17383 invoked by uid 9475); 24 Aug 2010 21:51:11 -0000 Date: 24 Aug 2010 21:51:11 -0000 Message-ID: <20100824215111.17381.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.9 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools ./multipath.conf.defaults libm ... 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 21:53:12 +0000 (UTC) --- multipath-tools/multipath.conf.defaults 2010/08/09 21:35:58 1.5.4.22 +++ multipath-tools/multipath.conf.defaults 2010/08/24 21:51:10 1.5.4.23 @@ -267,7 +267,7 @@ # vendor "HITACHI" # product "DF.*" # getuid_callout "/sbin/scsi_id -g -u -s /block/%n" -# prio_callout "/sbin/mpath_prio_hds_modular %d" +# prio_callout "/sbin/mpath_prio_hds_modular /dev/%n" # features "0" # hardware_handler "0" # path_grouping_policy group_by_prio @@ -395,7 +395,7 @@ # vendor "IBM" # product "1750500" # getuid_callout "/sbin/scsi_id -g -u -s /block/%n" -# prio_callout "/sbin/mpath_prio_alua %d" +# prio_callout "/sbin/mpath_prio_alua /dev/%n" # features "1 queue_if_no_path" # hardware_handler "0" # path_grouping_policy group_by_prio @@ -482,7 +482,7 @@ # vendor "Pillar" # product "Axiom [35]00" # getuid_callout "/sbin/scsi_id -g -u -s /block/%n" -# prio_callout "/sbin/mpath_prio_alua %d" +# prio_callout "/sbin/mpath_prio_alua /dev/%n" # features "0" # hardware_handler "0" # path_grouping_policy group_by_prio --- multipath-tools/libmultipath/hwtable.c 2010/08/09 21:35:58 1.20.2.29 +++ multipath-tools/libmultipath/hwtable.c 2010/08/24 21:51:10 1.20.2.30 @@ -289,7 +289,7 @@ .vendor = "HITACHI", .product = "DF.*", .getuid = DEFAULT_GETUID, - .getprio = "/sbin/mpath_prio_hds_modular %d", + .getprio = "/sbin/mpath_prio_hds_modular /dev/%n", .features = DEFAULT_FEATURES, .hwhandler = DEFAULT_HWHANDLER, .selector = DEFAULT_SELECTOR, @@ -646,7 +646,7 @@ .vendor = "Pillar", .product = "Axiom [35]00", .getuid = DEFAULT_GETUID, - .getprio = "/sbin/mpath_prio_alua %d", + .getprio = "/sbin/mpath_prio_alua /dev/%n", .features = DEFAULT_FEATURES, .hwhandler = DEFAULT_HWHANDLER, .selector = DEFAULT_SELECTOR, --- multipath-tools/path_priority/pp_hds_modular/pp_hds_modular.c 2006/06/06 18:32:44 1.2 +++ multipath-tools/path_priority/pp_hds_modular/pp_hds_modular.c 2010/08/24 21:51:10 1.2.2.1 @@ -99,7 +99,7 @@ int verbose; -int hds_modular_prio(char * major_minor) +int hds_modular_prio(char * device) { int sg_fd, k, i; char vendor[32]; @@ -117,16 +117,24 @@ unsigned char sense_buffer[32]; sg_io_hdr_t io_hdr; - sscanf(major_minor, "%u:%u", &major, &minor); memset(devpath, 0, FILE_NAME_SIZE); + if (sscanf(device, "%u:%u", &major, &minor) == 2) { - if (safe_sprintf(devpath, "/tmp/.pp_balance.%u.%u.devnode", - major, minor)) - exit(1); - - unlink (devpath); - mknod(devpath, S_IFBLK|S_IRUSR|S_IWUSR, makedev(major, minor)); + if (safe_sprintf(devpath, "/tmp/.pp_balance.%u.%u.devnode", + major, minor)) + exit(1); + unlink (devpath); + mknod(devpath, S_IFBLK|S_IRUSR|S_IWUSR, makedev(major, minor)); + } + else if (device[0] == '/') { + if (safe_sprintf(devpath, "%s", device)) + exit(1); + } + else { + if (safe_sprintf(devpath, "/dev/%s", device)) + exit(1); + } if ((sg_fd = open(devpath, O_RDONLY)) < 0) exit(1); if ((ioctl(sg_fd, SG_GET_VERSION_NUM, &k) < 0) || (k < 30000)) exit(1);