Updated to latest Upstream 0.4.8 code: multipath-tools-080519.tgz (git

commit id: 42704728855376d2f7da2de1967d7bc71bc54a2f)
This commit is contained in:
Benjamin Marzinski 2008-05-20 04:37:41 +00:00
parent ab958e7caf
commit 685fcac1ef
13 changed files with 2073 additions and 71 deletions

View File

@ -1,8 +1 @@
multipath-tools-0.4.5.59.tgz multipath-tools-080519.tgz
multipath-tools-0.4.7.tgz
multipath-tools-0.4.7.1.tgz
multipath-tools-0.4.7.2.tgz
multipath-tools-0.4.7.3.tgz
multipath-tools-0.4.7.4.tgz
multipath-tools-0.4.7.head1.tgz
multipath-tools-0.4.7.head2.tgz

199
cciss_id.patch Normal file
View File

@ -0,0 +1,199 @@
Index: multipath-tools-080519/cciss_id/cciss_id.c
===================================================================
--- /dev/null
+++ multipath-tools-080519/cciss_id/cciss_id.c
@@ -0,0 +1,128 @@
+/*
+ *****************************************************************************
+ * *
+ * (C) Copyright 2007 Hewlett-Packard Development Company, L.P *
+ * *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU General Public License as published by the Free*
+ * Software Foundation; either version 2 of the License, or (at your option)*
+ * any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY*
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
+ * for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License along *
+ * with this program; if not, write to the Free Software Foundation, Inc., *
+ * 675 Mass Ave, Cambridge, MA 02139, USA. *
+ * *
+ * *
+ * *
+ * *
+ *****************************************************************************
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include <linux/cciss_ioctl.h>
+
+#define LEN_PAGE83_CCISSDEV 0x20 /* Page length of 83h for cciss devices */
+#define LEN_DEVICEFILE 255 /* Length of device file name */
+#define PATH_CCISSDEV "/dev/cciss/" /* Path of CCISS devices */
+int main(int argc, char *argv[])
+{
+ const int resp_len = LEN_PAGE83_CCISSDEV;
+ unsigned char resp[resp_len+1];
+ char dev_name[LEN_DEVICEFILE] = "\0" ;
+ unsigned int lun_id = 0;
+ int fd, status, i;
+ struct stat file_stat;
+
+ LogvolInfo_struct lvi; // logical "volume" info
+ IOCTL_Command_struct cic; // cciss ioctl command
+
+ if(argc < 2) {
+ fprintf(stderr, "Usage: %s /dev/cciss/cNdN\n", argv[0]);
+ return -1;
+ }
+
+ if ( strncmp(PATH_CCISSDEV, argv[1], strlen(PATH_CCISSDEV) ) != 0 ) {
+ if ( strchr(argv[1], '!') ) {
+ sprintf(dev_name, "%s%s", PATH_CCISSDEV,
+ strchr(argv[1], '!')+1);
+ }
+ //fprintf(stderr, "dev_name is: -%s-", dev_name);
+ } else {
+ sprintf(dev_name, "%s", argv[1]);
+ }
+
+ if (stat(dev_name, &file_stat) < 0) {
+ fprintf (stderr, "Stat failed for file %s. Errno=%d\n", dev_name, errno);
+ return -1;
+ }
+ if (!S_ISBLK(file_stat.st_mode)) {
+ fprintf (stderr, "File %s is not a block device. \n", dev_name);
+ return -1;
+ }
+
+
+ if((fd = open(dev_name, O_RDWR)) < 0) {
+ fprintf(stderr, "Open failed for file %s. Errno=%d\n", dev_name, errno);
+ return -1;
+ }
+
+ if (ioctl(fd, CCISS_GETLUNINFO, &lvi) < 0) {
+ fprintf(stderr, "IOCTL failure CCISS_GETLUNINFO for file %s Errno=%d\n", dev_name, errno);
+ close(fd);
+ return -1;
+ } else {
+ lun_id = lvi.LunID;
+ }
+
+ memset(&cic, 0, sizeof(IOCTL_Command_struct));
+ memset(resp, 0, resp_len+1);
+ cic.LUN_info.LogDev.Mode = 0x01; /* logical volume addressing */
+ cic.LUN_info.LogDev.VolId = lun_id & 0x3FFFFFFF;
+ cic.Request.CDBLen = 6;
+ cic.Request.Type.Type = TYPE_CMD; // It is a command.
+ cic.Request.Type.Attribute = ATTR_SIMPLE;
+ cic.Request.Type.Direction = XFER_READ; // Read
+ cic.Request.Timeout = 0; // Don't time out
+ cic.Request.CDB[0] = 0x12;
+ cic.Request.CDB[1] = 0x01; /* EVPD (enable vital product data) */
+ cic.Request.CDB[2] = 0x83;
+ cic.Request.CDB[4] = resp_len & 0xFF;
+ cic.buf_size = resp_len;
+ cic.buf = resp;
+ status = ioctl(fd, CCISS_PASSTHRU, &cic);
+ if(status) {
+ fprintf(stderr, "IOCTL failure CCISS_PASSTHRU for file %s Errno=%d\n", dev_name, errno);
+ close(fd);
+ return -1;
+ }
+ else {
+ if ((cic.error_info.CommandStatus | cic.error_info.ScsiStatus )) {
+ fprintf(stderr, "CCISS command status error for Inquiry on %s\n",
+ dev_name);
+ close(fd);
+ return -1;
+ }
+ printf("3");
+ for(i=8; i<24; i++)
+ /* printf("Buff[%d] =%x\n", i, resp[i]); */
+ printf("%02x", resp[i]);
+ printf("\n");
+ }
+
+ close(fd);
+ return 0;
+}
Index: multipath-tools-080519/cciss_id/Makefile
===================================================================
--- /dev/null
+++ multipath-tools-080519/cciss_id/Makefile
@@ -0,0 +1,47 @@
+
+# *****************************************************************************
+# * *
+# * (C) Copyright 2007 Hewlett-Packard Development Company, L.P *
+# * *
+# * This program is free software; you can redistribute it and/or modify it *
+# * under the terms of the GNU General Public License as published by the Free*
+# * Software Foundation; either version 2 of the License, or (at your option)*
+# * any later version. *
+# * *
+# * This program is distributed in the hope that it will be useful, but *
+# * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY*
+# * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
+# * for more details. *
+# * *
+# * You should have received a copy of the GNU General Public License along *
+# * with this program; if not, write to the Free Software Foundation, Inc., *
+# * 675 Mass Ave, Cambridge, MA 02139, USA. *
+# * *
+# * *
+# * *
+# * *
+# *****************************************************************************
+
+include ../Makefile.inc
+
+OBJS = cciss_id.o
+CFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes
+
+LDFLAGS = -ldevmapper
+
+EXEC = cciss_id
+
+all: $(EXEC)
+
+$(EXEC): $(OBJS)
+ $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
+
+install:
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
+ $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+
+uninstall:
+ rm $(DESTDIR)$(bindir)/$(EXEC)
+
+clean:
+ rm -f core.* *.o $(EXEC) *.gz
Index: multipath-tools-080519/Makefile
===================================================================
--- multipath-tools-080519.orig/Makefile
+++ multipath-tools-080519/Makefile
@@ -25,7 +25,8 @@ BUILDDIRS = \
libmultipath/checkers \
multipath \
multipathd \
- kpartx
+ kpartx \
+ cciss_id
ifeq ($(MULTIPATH_VERSION),)
VERSION = $(shell basename ${PWD} | cut -d'-' -f3)

936
config_files.patch Normal file
View File

@ -0,0 +1,936 @@
diff -urpN multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.annotated multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.annotated
--- multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.annotated 2008-04-30 06:25:16.000000000 -0500
+++ multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.annotated 2008-05-02 18:22:48.000000000 -0500
@@ -19,6 +19,7 @@
# # name : polling_interval
# # scope : multipathd
# # desc : interval between two path checks in seconds
+# # values : n > 0
# # default : 5
# #
# polling_interval 10
@@ -38,6 +39,13 @@
# # scope : multipath
# # desc : the default path grouping policy to apply to unspecified
# # multipaths
+# # values : failover = 1 path per priority group
+# # multibus = all valid paths in 1 priority group
+# # group_by_serial = 1 priority group per detected serial
+# # number
+# # group_by_prio = 1 priority group per path priority
+# # value
+# # group_by_node_name = 1 priority group per target node name
# # default : failover
# #
# path_grouping_policy multibus
@@ -59,16 +67,27 @@
# # exploitable prio value for example.
# # default : (null)
# #
-# #prio "alua"
+# prio "alua"
#
# #
-# # name : path_checker
+# # name : features
+# # scope : multipath
+# # desc : The default extra features of multipath devices. The
+# # only existing feature currently is queue_if_no_path, which
+# # is the same as setting no_path_retry to queue.
+# # values : "1 queue_if_no_path"
+# # default : (null)
+# #
+# features "1 queue_if_no_path"
+#
+# #
+# # name : path_checker, checker
# # scope : multipath & multipathd
# # desc : the default method used to determine the paths' state
-# # values : readsector0|tur|emc_clariion|hp_sw|directio
+# # values : readsector0|tur|emc_clariion|hp_sw|directio|rdac|cciss_tur
# # default : directio
# #
-# #path_checker directio
+# path_checker directio
#
# #
# # name : rr_min_io
@@ -103,8 +122,8 @@
# # name : failback
# # scope : multipathd
# # desc : tell the daemon to manage path group failback, or not to.
-# # 0 means immediate failback, values >0 means deffered failback
-# # expressed in seconds.
+# # 0 means immediate failback, values >0 means deffered
+# # failback expressed in seconds.
# # values : manual|immediate|n > 0
# # default : manual
# #
@@ -119,7 +138,7 @@
# # values : queue|fail|n (>0)
# # default : (null)
# #
-# #no_path_retry queue
+# no_path_retry queue
#
# #
# # name : user_friendly_names
@@ -140,13 +159,16 @@
## name : blacklist
## scope : multipath & multipathd
## desc : list of device names to discard as not multipath candidates
-## default : cciss, fd, hd, md, dm, sr, scd, st, ram, raw, loop
+## Devices can be identified by their device node name "devnode",
+## their WWID "wwid", or their vender and product strings
+## "device"
+## default : fd, hd, md, dm, sr, scd, st, ram, raw, loop, dcssblk
##
#blacklist {
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
-# devnode "^hd[a-z][[0-9]*]"
-# devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
+# devnode "^hd[a-z]"
+# devnode "^dcssblk[0-9]*"
# device {
# vendor DEC.*
# product MSA[15]00
@@ -199,57 +221,59 @@
# # name : path_grouping_policy
# # scope : multipath
# # desc : path grouping policy to apply to this multipath
-# # values : failover, multibus, group_by_serial
-# # default : failover
+# # multibus = all valid paths in 1 priority
+# # group
+# # group_by_serial = 1 priority group per detected
+# # serial number
+# # group_by_prio = 1 priority group per path
+# # priority value
+# # group_by_node_name = 1 priority group per target
+# # node name
# #
-# path_grouping_policy multibus
+# path_grouping_policy failover
#
# #
-# # name : path_checker
-# # scope : multipathd
-# # desc : path checking alorithm to use to check path state
-# # values : readsector0|tur|emc_clariion|hp_sw|directio
-# # default : directio
-# #
-# # path_checker directio
-#
-# #
# # name : path_selector
# # desc : the path selector algorithm to use for this mpath
# # these algo are offered by the kernel mpath target
# # values : "round-robin 0"
-# # default : "round-robin 0"
# #
# path_selector "round-robin 0"
#
# #
# # name : failback
# # scope : multipathd
-# # desc : tell the daemon to manage path group failback, or not to.
-# # 0 means immediate failback, values >0 means deffered failback
-# # expressed in seconds.
+# # desc : tell the daemon to manage path group failback, or
+# # not to. 0 means immediate failback, values >0 means
+# # deffered failback expressed in seconds.
# # values : manual|immediate|n > 0
-# # default : manual
# #
-# failback immediate
+# failback manual
+#
+# #
+# # name : rr_weight
+# # scope : multipath
+# # desc : if set to priorities the multipath configurator will
+# # assign path weights as "path prio * rr_min_io"
+# # values : priorities|uniform
+# #
+# rr_weight priorities
#
# #
# # name : no_path_retry
# # scope : multipath & multipathd
-# # desc : tell the number of retries until disable queueing, or
-# # "fail" means immediate failure (no queueing),
+# # desc : tell the number of retries until disable queueing,
+# # or "fail" means immediate failure (no queueing),
# # "queue" means never stop queueing
# # values : queue|fail|n (>0)
-# # default : (null)
# #
-# #no_path_retry queue
+# no_path_retry queue
#
# #
# # name : rr_min_io
# # scope : multipath
# # desc : the number of IO to route to a path before switching
# # to the next in the same path group
-# # default : 1000
# #
# rr_min_io 100
# }
@@ -283,83 +307,120 @@
# product "HSV110 (C)COMPAQ"
#
# #
+# # name : product_blacklist
+# # scope : multipath & multipathd
+# # desc : product strings to blacklist for this vendor
+# # default : none
+# #
+# product_blacklist LUNZ
+#
+# #
# # name : path_grouping_policy
# # scope : multipath
# # desc : path grouping policy to apply to multipath hosted
# # by this storage controller
-# # values : failover = 1 path per priority group
-# # multibus = all valid paths in 1 priority
-# # group
-# # group_by_serial = 1 priority group per detected
-# # serial number
-# # default : failover
+# # values : failover = 1 path per priority group
+# # multibus = all valid paths in 1 priority
+# # group
+# # group_by_serial = 1 priority group per detected
+# # serial number
+# # group_by_prio = 1 priority group per path
+# # priority value
+# # group_by_node_name = 1 priority group per target
# #
-# path_grouping_policy multibus
+# path_grouping_policy failover
#
# #
# # name : getuid_callout
# # scope : multipath
# # desc : the program and args to callout to obtain a unique
# # path identifier. Absolute path required
-# # default : /lib/udev/scsi_id -g -u -s
# #
# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
#
# #
-# # name : prio
-# # scope : multipath
-# # desc : the function to call to obtain a path
-# # weight. Weights are summed for each path group to
-# # determine the next PG to use case of failure.
-# # default : no callout, all paths equals
+# # name : path_selector
+# # desc : the path selector algorithm to use for this mpath
+# # these algo are offered by the kernel mpath target
+# # values : "round-robin 0"
# #
-# prio "hp_sw"
+# path_selector "round-robin 0"
#
# #
-# # name : path_checker
+# # name : path_checker, checker
# # scope : multipathd
# # desc : path checking alorithm to use to check path state
-# # values : readsector0|tur|emc_clariion|hp_sw|directio
-# # default : directio
+# # values : readsector0|tur|emc_clariion|hp_sw|directio|rdac|
+# # cciss_tur
# #
# path_checker directio
#
# #
-# # name : path_selector
-# # desc : the path selector algorithm to use for this mpath
-# # these algo are offered by the kernel mpath target
-# # values : "round-robin 0"
-# # default : "round-robin 0"
+# # name : features
+# # scope : multipath
+# # desc : The extra features of multipath devices. The only
+# # existing feature currently is queue_if_no_path,
+# # which is the same as setting no_path_retry to queue.
+# # values : "1 queue_if_no_path"
# #
-# path_selector "round-robin 0"
+# features "1 queue_if_no_path"
+#
+# #
+# # name : hardware_handler
+# # scope : multipath
+# # desc : If set, it specifies a module that will be used to
+# # perform hardware specific actions when switching
+# # path groups or handling IO errors
+# # values : "0"|"1 emc"
+# # default : "0"
+# #
+# hardware_handler "1 emc"
+#
+# #
+# # name : prio
+# # scope : multipath
+# # desc : the function to call to obtain a path
+# # weight. Weights are summed for each path group to
+# # determine the next PG to use case of failure.
+# #
+# prio "hp_sw"
#
# #
# # name : failback
# # scope : multipathd
-# # desc : tell the daemon to manage path group failback, or not to.
-# # 0 means immediate failback, values >0 means deffered failback
-# # expressed in seconds.
+# # desc : tell the daemon to manage path group failback, or
+# # not to. 0 means immediate failback, values >0 means
+# # deffered failback expressed in seconds.
# # values : manual|immediate|n > 0
-# # default : manual
# #
# failback 30
#
# #
-# # name : rr_min_io
+# # name : rr_weight
# # scope : multipath
-# # desc : the number of IO to route to a path before switching
-# # to the next in the same path group
-# # default : 1000
+# # desc : if set to priorities the multipath configurator will
+# # assign path weights as "path prio * rr_min_io"
+# # values : priorities|uniform
# #
-# rr_min_io 100
+# rr_weight priorities
#
# #
-# # name : product_blacklist
+# # name : no_path_retry
# # scope : multipath & multipathd
-# # desc : product strings to blacklist for this vendor
-# # default : none
+# # desc : tell the number of retries until disable queueing,
+# # or "fail" means immediate failure (no queueing),
+# # "queue" means never stop queueing
+# # values : queue|fail|n (>0)
# #
-# product_blacklist LUN_Z
+# no_path_retry queue
+#
+# #
+# # name : rr_min_io
+# # scope : multipath
+# # desc : the number of IO to route to a path before switching
+# # to the next in the same path group
+# #
+# rr_min_io 100
# }
# device {
# vendor "COMPAQ "
diff -urpN multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.defaults multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.defaults
--- multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.defaults 1969-12-31 18:00:00.000000000 -0600
+++ multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.defaults 2008-05-02 18:54:06.000000000 -0500
@@ -0,0 +1,574 @@
+# These are the compiled in default settings. They will be used unless you
+# overwrite these values in your config file.
+
+#defaults {
+# udev_dir /dev
+# polling_interval 5
+# selector "round-robin 0"
+# path_grouping_policy failover
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# prio const
+# path_checker directio
+# rr_min_io 1000
+# rr_weight uniform
+# failback manual
+# no_path_retry fail
+# user_friendly_names no
+#}
+#
+#blacklist {
+# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
+# devnode "^hd[a-z]"
+# devnode "^dcssblk[0-9]*"
+#}
+#
+#devices {
+# device {
+# vendor "APPLE*"
+# product "Xserve RAID"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "3PARdata"
+# product "VV"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "DEC"
+# product "HSG80"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "1 hp-sw"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker hp_sw
+# prio hp_sw
+# }
+# device {
+# vendor "HP"
+# product "A6189A"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "(COMPAQ|HP)"
+# product "(MSA|HSV)1.0.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "1 hp-sw"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker hp_sw
+# prio hp_sw
+# }
+# device {
+# vendor "HP"
+# product "MSA VOLUME"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker tur
+# prio alua
+# }
+# device {
+# vendor "HP"
+# product "MSA2000s*"
+# getuid_callout "/sbin/cciss_id %n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "(COMPAQ|HP)"
+# product "HSV1[01]1|HSV2[01]0|HSV300"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker tur
+# prio alua
+# }
+# device {
+# vendor "HP"
+# product "MSA2[02]12*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "HP"
+# product "LOGICAL VOLUME.*"
+# getuid_callout "/lib/udev/scsi_id -n -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "DDN"
+# product "SAN DataDirector"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "EMC"
+# product "SYMMETRIX"
+# getuid_callout "/lib/udev/scsi_id -g -u -ppre-spc3-83 -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "DGC"
+# product ".*"
+# product_blacklist "LUNZ"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# prio_callout "/sbin/mpath_prio_emc /dev/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "1 emc"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry 60
+# rr_min_io 1000
+# path_checker emc_clariion
+# prio emc
+# }
+# device {
+# vendor "FSC"
+# product "CentricStor"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_serial
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "(HITACHI|HP)"
+# product "OPEN-.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 100
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "HITACHI"
+# product "DF.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio hds
+# }
+# device {
+# vendor "IBM"
+# product "ProFibre 4000R"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker readsector0
+# prio const
+# }
+# device {
+# vendor "IBM"
+# product "1722-600"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry 300
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "IBM"
+# product "1742"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "IBM"
+# product "1814"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "IBM"
+# product "1815"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "IBM"
+# product "3526"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "IBM"
+# product "3542"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_serial
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "IBM"
+# product "2105(800|F20)"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_serial
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "IBM"
+# product "1750500"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio alua
+# }
+# device {
+# vendor "IBM"
+# product "2107900"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "IBM"
+# product "2145"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio alua
+# }
+# device {
+# vendor "IBM"
+# product "S/390 DASD ECKD"
+# product_blacklist "S/390.*"
+# getuid_callout "/sbin/dasdinfo -u -b %n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "NETAPP"
+# product "LUN.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 128
+# path_checker directio
+# prio netapp
+# }
+# device {
+# vendor "IBM"
+# product "Nseries.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 128
+# path_checker directio
+# prio netapp
+# }
+# device {
+# vendor "Pillar"
+# product "Axiom.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio alua
+# }
+# device {
+# vendor "SGI"
+# product "TP9[13]00"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "SGI"
+# product "TP9[45]00"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "SGI"
+# product "IS.*"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "STK"
+# product "OPENstorage D280"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio rdac
+# }
+# device {
+# vendor "SUN"
+# product "(StorEdge 3510|T4)"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker directio
+# prio const
+# }
+# device {
+# vendor "PIVOT3"
+# product "RAIGE VOLUME"
+# getuid_callout "/sbin/scsi_id -p 0x80 -g -u -s /block/%n"
+# features "1 queue_if_no_path"
+# hardware_handler "0"
+# path_selector "round-robin 0"
+# path_grouping_policy multibus
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker tur
+# prio const
+# }
+# device {
+# vendor "SUN"
+# product "CSM200_R"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+# device {
+# vendor "SUN"
+# product "LCSM100_F"
+# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback immediate
+# rr_weight uniform
+# no_path_retry queue
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
+#}
diff -urpN multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.synthetic multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.synthetic
--- multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-clean/multipath.conf.synthetic 2008-04-30 06:25:16.000000000 -0500
+++ multipath-tools-cf94ef0ee3f8046aa2b8dc90aee14edf76d4bbf7-patched/multipath.conf.synthetic 2008-05-02 18:56:12.000000000 -0500
@@ -21,7 +21,6 @@
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z][[0-9]*]"
-# devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
# device {
# vendor DEC.*
# product MSA[15]00
@@ -61,7 +60,7 @@
# rr_weight priorities
# no_path_retry queue
# rr_min_io 100
-# product_blacklist LUN_Z
+# product_blacklist LUNZ
# }
# device {
# vendor "COMPAQ "

View File

@ -1,25 +1,33 @@
Summary: Tools to manage multipath devices using device-mapper Summary: Tools to manage multipath devices using device-mapper
Name: device-mapper-multipath Name: device-mapper-multipath
Version: 0.4.7 Version: 0.4.8
Release: 15%{?dist} Release: 1%{?dist}
License: GPL+ License: GPL+
Group: System Environment/Base Group: System Environment/Base
URL: http://christophe.varoqui.free.fr/ URL: http://christophe.varoqui.free.fr/
Source0: multipath-tools-0.4.7.head2.tgz Source0: multipath-tools-080519.tgz
Patch0: multipath-tools-0.4.7.head2-sparc64fix.patch Patch0: makefiles_fix.patch
Patch1: multipath-tools-0.4.7.head2-nostatic.patch Patch1: linking_change.patch
Patch2: uevent_fix.patch
Patch3: sparc64fix.patch
Patch4: directio_fix.patch
Patch5: config_files.patch
Patch6: redhatification.patch
Patch7: mpath_wait.patch
Patch8: multipath_rules.patch
Patch9: cciss_id.patch
Requires: kpartx = %{version}-%{release} Requires: kpartx = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): chkconfig Requires(post): chkconfig
Requires(preun): chkconfig Requires(preun): chkconfig
Requires: device-mapper >= 1.02.02-2 Requires: device-mapper >= 1.02.02-2
BuildRequires: libsysfs-devel, device-mapper-devel BuildRequires: libaio-devel, device-mapper-devel
BuildRequires: libselinux-devel, libsepol-devel BuildRequires: libselinux-devel, libsepol-devel
BuildRequires: readline-devel, ncurses-devel BuildRequires: readline-devel, ncurses-devel
%description %description
%{name} provides tools to manage multipath devices by instructing the %{name} provides tools to manage multipath devices by
device-mapper multipath kernel module what to do. instructing the device-mapper multipath kernel module what to do.
The tools are : The tools are :
* multipath : Scan the system for multipath devices and assemble them. * multipath : Scan the system for multipath devices and assemble them.
* multipathd : Detects when paths fail and execs multipath to update things. * multipathd : Detects when paths fail and execs multipath to update things.
@ -33,12 +41,20 @@ Provides: kpartx = %{version}-%{release}
kpartx manages partition creation and removal for device-mapper devices. kpartx manages partition creation and removal for device-mapper devices.
%prep %prep
%setup -q -n multipath-tools-0.4.7.head2 %setup -q -n multipath-tools-080519
%patch0 -p1 -b .sparc64 %patch0 -p1 -b .makefiles_fix
%patch1 -p1 -b .nostatic %patch1 -p1 -b .linking_change
%patch2 -p1 -b .uevent_fix
%patch3 -p1 -b .sparc64fix
%patch4 -p1 -b .directio_fix
%patch5 -p1 -b .config_files
%patch6 -p1 -b .redhatification
%patch7 -p1 -b .mpath_wait
%patch8 -p1 -b .multipath_rules
%patch9 -p1 -b .cciss_id
%build %build
make DESTDIR=$RPM_BUILD_ROOT make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -48,39 +64,49 @@ make install DESTDIR=$RPM_BUILD_ROOT bindir=/sbin rcdir=/etc/rc.d/init.d
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
/sbin/ldconfig
/sbin/chkconfig --add multipathd /sbin/chkconfig --add multipathd
%preun %preun
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
/sbin/service multipathd stop /dev/null 2>&1
/sbin/chkconfig --del multipathd /sbin/chkconfig --del multipathd
fi fi
%postun
/sbin/ldconfig
if [ "$1" - ge "1" ]; then
/sbin/service multipathd condrestart >/dev/null 2>&1 || :
fi
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/sbin/multipath /sbin/multipath
/sbin/multipathd /sbin/multipathd
/sbin/mpath_prio_alua /sbin/cciss_id
/sbin/mpath_prio_emc
/sbin/mpath_prio_netapp
/sbin/mpath_prio_hds_modular
/sbin/mpath_prio_tpc
/sbin/mpath_wait /sbin/mpath_wait
/sbin/mpath_ctl /lib/libmultipath.so
/etc/udev/rules.d/40-multipath.rules /lib/multipath
%{_mandir}/man8/mpath_prio_alua.8.gz /etc/rc.d/init.d/multipathd
%{_mandir}/man5/multipath.conf.5.gz
%{_mandir}/man8/multipath.8.gz %{_mandir}/man8/multipath.8.gz
%{_mandir}/man8/multipathd.8.gz %{_mandir}/man8/multipathd.8.gz
%config /etc/rc.d/init.d/multipathd %config /etc/udev/rules.d/40-multipath.rules
%config(noreplace) /etc/multipath.conf %config(noreplace) /etc/multipath.conf
%doc AUTHOR COPYING README* FAQ Multipath-usage.txt multipath.conf.annotated multipath.conf.defaults multipath.conf.synthetic %doc AUTHOR COPYING README* FAQ multipath.conf.annotated multipath.conf.defaults multipath.conf.synthetic
%dir /var/lib/multipath %dir /var/lib/multipath
%files -n kpartx %files -n kpartx
%defattr(-,root,root,-) %defattr(-,root,root,-)
/sbin/kpartx /sbin/kpartx
%{_mandir}/man8/kpartx.8.gz %{_mandir}/man8/kpartx.8.gz
%changelog %changelog
* Mon May 19 2008 Benjamin Marzinski <bmarzins@redhat.com> 0.4.8-1
- Updated to latest Upstream 0.4.8 code: multipath-tools-080519.tgz
(git commit id: 42704728855376d2f7da2de1967d7bc71bc54a2f)
* Tue May 06 2008 Alasdair Kergon <agk@redhat.com> - 0.4.7-15 * Tue May 06 2008 Alasdair Kergon <agk@redhat.com> - 0.4.7-15
- Remove unnecessary multipath & kpartx static binaries. (bz 234928) - Remove unnecessary multipath & kpartx static binaries. (bz 234928)

21
directio_fix.patch Normal file
View File

@ -0,0 +1,21 @@
Index: multipath-tools-temp/libmultipath/checkers/directio.c
===================================================================
--- multipath-tools-temp.orig/libmultipath/checkers/directio.c
+++ multipath-tools-temp/libmultipath/checkers/directio.c
@@ -15,6 +15,7 @@
#include <linux/kdev_t.h>
#include <asm/unistd.h>
#include <libaio.h>
+#include <sys/syscall.h>
#include "checkers.h"
#include "../libmultipath/debug.h"
@@ -148,7 +149,7 @@ check_state(int fd, struct directio_cont
}
ct->running++;
- r = io_getevents(ct->ioctx, 1L, 1L, &event, &timeout);
+ r = syscall(SYS_io_getevents, ct->ioctx, 1L, 1L, &event, &timeout);
LOG(3, "async io getevents returns %li (errno=%s)", r, strerror(errno));
if (r < 1L) {

50
linking_change.patch Normal file
View File

@ -0,0 +1,50 @@
Index: multipath-tools-080519/libmultipath/Makefile
===================================================================
--- multipath-tools-080519.orig/libmultipath/Makefile
+++ multipath-tools-080519/libmultipath/Makefile
@@ -23,14 +23,16 @@ endif
all: $(LIBS)
$(LIBS): $(OBJS)
- $(CC) $(SHARED_FLAGS) $(CFLAGS) -o $@ $(OBJS)
+ $(CC) $(SHARED_FLAGS) -Wl,-soname,$@ $(CFLAGS) -o $@ $(OBJS)
install:
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(prefix)/lib
+ $(INSTALL_PROGRAM) -o root -g root -m 755 $(LIBS) $(DESTDIR)$(prefix)/lib/$(LIBS)
$(INSTALL_PROGRAM) -o root -g root -m 755 -d $(DESTDIR)$(libdir)
- $(INSTALL_PROGRAM) -o root -g root -m 755 $(LIBS) $(DESTDIR)$(libdir)/$(LIBS)
+ ldconfig
uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIBS)
+ rm -f $(DESTDIR)$(prefix)/lib/$(LIBS)
clean:
rm -f core *.a *.o *.gz *.so
Index: multipath-tools-080519/multipath/Makefile
===================================================================
--- multipath-tools-080519.orig/multipath/Makefile
+++ multipath-tools-080519/multipath/Makefile
@@ -6,7 +6,7 @@ include ../Makefile.inc
OBJS = main.o
-CFLAGS += -I$(multipathdir) -Wl,-rpath,$(libdir)
+CFLAGS += -I$(multipathdir)
LDFLAGS += -lpthread -ldevmapper -laio -ldl \
-lmultipath -L$(multipathdir)
Index: multipath-tools-080519/multipathd/Makefile
===================================================================
--- multipath-tools-080519.orig/multipathd/Makefile
+++ multipath-tools-080519/multipathd/Makefile
@@ -5,7 +5,7 @@ include ../Makefile.inc
#
# basic flags setting
#
-CFLAGS += -I$(multipathdir) -Wl,-rpath,$(libdir)
+CFLAGS += -I$(multipathdir)
LDFLAGS += -lpthread -ldevmapper -lreadline -lncurses -laio -ldl \
-lmultipath -L$(multipathdir)

43
mpath_wait.patch Normal file
View File

@ -0,0 +1,43 @@
Index: multipath-tools-080515/multipath/Makefile
===================================================================
--- multipath-tools-080515.orig/multipath/Makefile
+++ multipath-tools-080515/multipath/Makefile
@@ -21,7 +21,7 @@ $(EXEC): $(OBJS)
install:
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ $(INSTALL_PROGRAM) -m 755 $(EXEC) mpath_wait $(DESTDIR)$(bindir)/
$(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
@@ -36,6 +36,7 @@ install:
uninstall:
rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
rm $(DESTDIR)$(bindir)/$(EXEC)
+ rm $(DESTDIR)$(bindir)/mpath_wait
rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz
Index: multipath-tools-080515/multipath/mpath_wait
===================================================================
--- /dev/null
+++ multipath-tools-080515/multipath/mpath_wait
@@ -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

View File

@ -1,37 +0,0 @@
--- multipath-tools-0.4.7.head2/kpartx/Makefile 2006-10-12 17:16:09.000000000 +0100
+++ multipath-tools-0.4.7.head2.new/kpartx/Makefile 2008-05-06 18:59:14.000000000 +0100
@@ -24,7 +24,6 @@
glibc: clean $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(CC) $(OBJS) -o $(EXEC).static -static $(LDFLAGS) -lselinux -lsepol
klibc: clean $(OBJS)
$(CC) -static -o $(EXEC) $(CRT0) $(OBJS) $(KLIBC) $(LIBGCC)
@@ -36,7 +35,6 @@
install:
install -d $(DESTDIR)$(bindir)
install -m 755 $(EXEC) $(DESTDIR)$(bindir)
- install -m 755 $(EXEC).static $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(mandir)
install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
--- multipath-tools-0.4.7.head2/multipath/Makefile 2006-11-30 23:25:13.000000000 +0000
+++ multipath-tools-0.4.7.head2.new/multipath/Makefile 2008-05-06 18:58:53.000000000 +0100
@@ -21,7 +21,6 @@
glibc: clean $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(CC) $(OBJS) -o $(EXEC).static -static $(LDFLAGS) -lselinux -lsepol
$(CC) mpath_faker.c -o mpath_ctl $(CFLAGS) -static
klibc: $(OBJS)
@@ -36,7 +35,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -m 755 $(EXEC) $(EXEC).static mpath_ctl mpath_wait $(DESTDIR)$(bindir)/
+ install -m 755 $(EXEC) mpath_ctl mpath_wait $(DESTDIR)$(bindir)/
install -d $(DESTDIR)/etc/udev/rules.d
install -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
install -d $(DESTDIR)$(mandir)

43
multipath_rules.patch Normal file
View File

@ -0,0 +1,43 @@
Index: multipath-tools-080515/multipath/Makefile
===================================================================
--- multipath-tools-080515.orig/multipath/Makefile
+++ multipath-tools-080515/multipath/Makefile
@@ -23,7 +23,7 @@ install:
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -m 755 $(EXEC) mpath_wait $(DESTDIR)$(bindir)/
$(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
- $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
+ $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
@@ -34,7 +34,7 @@ install:
$(INSTALL_PROGRAM) -d $(DESTDIR)/var/lib/multipath
uninstall:
- rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
+ rm $(DESTDIR)/etc/udev/rules.d/40-multipath.rules
rm $(DESTDIR)$(bindir)/$(EXEC)
rm $(DESTDIR)$(bindir)/mpath_wait
rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
Index: multipath-tools-080515/multipath/multipath.rules
===================================================================
--- multipath-tools-080515.orig/multipath/multipath.rules
+++ multipath-tools-080515/multipath/multipath.rules
@@ -1,7 +1,9 @@
-#
-# udev rules for multipathing.
-# The persistent symlinks are created with the kpartx rules
-#
-
-# socket for uevents
-RUN+="socket:/org/kernel/dm/multipath_event"
+# multipath wants the devmaps presented as meaninglful device names
+# so name them after their devmap name
+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 -p p' -j %M -m %m"
+PROGRAM!="/bin/bash -c '/sbin/dmsetup info -c --noheadings -j %M -m %m | /bin/grep -q .*:.*:.*:.*:.*:.*:.*:part[0-9]*-mpath-'", GOTO="end_mpath"
+LABEL="end_mpath"

699
redhatification.patch Normal file
View File

@ -0,0 +1,699 @@
Index: multipath-tools-080519/libmultipath/defaults.h
===================================================================
--- multipath-tools-080519.orig/libmultipath/defaults.h
+++ multipath-tools-080519/libmultipath/defaults.h
@@ -1,4 +1,4 @@
-#define DEFAULT_GETUID "/lib/udev/scsi_id -g -u -s /block/%n"
+#define DEFAULT_GETUID "/sbin/scsi_id -g -u -s /block/%n"
#define DEFAULT_UDEVDIR "/dev"
#define DEFAULT_MULTIPATHDIR "/lib/multipath"
#define DEFAULT_SELECTOR "round-robin 0"
Index: multipath-tools-080519/libmultipath/hwtable.c
===================================================================
--- multipath-tools-080519.orig/libmultipath/hwtable.c
+++ multipath-tools-080519/libmultipath/hwtable.c
@@ -172,7 +172,7 @@ static struct hwentry default_hw[] = {
/* HP Smart Array */
.vendor = "HP",
.product = "LOGICAL VOLUME.*",
- .getuid = "/lib/udev/scsi_id -n -g -u -s /block/%n",
+ .getuid = "/sbin/scsi_id -n -g -u -s /block/%n",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
.selector = DEFAULT_SELECTOR,
@@ -214,7 +214,7 @@ static struct hwentry default_hw[] = {
{
.vendor = "EMC",
.product = "SYMMETRIX",
- .getuid = "/lib/udev/scsi_id -g -u -ppre-spc3-83 -s /block/%n",
+ .getuid = "/sbin/scsi_id -g -u -ppre-spc3-83 -s /block/%n",
.features = DEFAULT_FEATURES,
.hwhandler = DEFAULT_HWHANDLER,
.selector = DEFAULT_SELECTOR,
@@ -485,7 +485,7 @@ static struct hwentry default_hw[] = {
.vendor = "IBM",
.product = "S/390 DASD ECKD",
.bl_product = "S/390.*",
- .getuid = "/sbin/dasdinfo -u -b %n",
+ .getuid = "/sbin/dasd_id /dev/%n",
.features = "1 queue_if_no_path",
.hwhandler = DEFAULT_HWHANDLER,
.selector = DEFAULT_SELECTOR,
@@ -705,6 +705,22 @@ static struct hwentry default_hw[] = {
.checker_name = RDAC,
.prio_name = PRIO_RDAC,
},
+ /* DELL arrays */
+ {
+ .vendor = "DELL",
+ .product = "MD3000",
+ .getuid = DEFAULT_GETUID,
+ .features = DEFAULT_FEATURES,
+ .hwhandler = "1 rdac",
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = GROUP_BY_PRIO,
+ .pgfailback = -FAILBACK_MANUAL,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = NO_PATH_RETRY_UNDEF,
+ .minio = DEFAULT_MINIO,
+ .checker_name = RDAC,
+ .prio_name = PRIO_RDAC,
+ },
/*
* EOL
*/
Index: multipath-tools-080519/multipath.conf.annotated
===================================================================
--- multipath-tools-080519.orig/multipath.conf.annotated
+++ multipath-tools-080519/multipath.conf.annotated
@@ -55,9 +55,9 @@
# # scope : multipath
# # desc : the default program and args to callout to obtain a unique
# # path identifier. Absolute path required
-# # default : /lib/udev/scsi_id -g -u -s
+# # default : /sbin/scsi_id -g -u -s
# #
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
#
# #
# # name : prio
@@ -336,7 +336,7 @@
# # desc : the program and args to callout to obtain a unique
# # path identifier. Absolute path required
# #
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
#
# #
# # name : path_selector
Index: multipath-tools-080519/multipath.conf.defaults
===================================================================
--- multipath-tools-080519.orig/multipath.conf.defaults
+++ multipath-tools-080519/multipath.conf.defaults
@@ -6,7 +6,7 @@
# polling_interval 5
# selector "round-robin 0"
# path_grouping_policy failover
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# prio const
# path_checker directio
# rr_min_io 1000
@@ -26,7 +26,7 @@
# device {
# vendor "APPLE*"
# product "Xserve RAID"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -39,7 +39,7 @@
# device {
# vendor "3PARdata"
# product "VV"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -52,7 +52,7 @@
# device {
# vendor "DEC"
# product "HSG80"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "1 hp-sw"
# path_selector "round-robin 0"
@@ -65,7 +65,7 @@
# device {
# vendor "HP"
# product "A6189A"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -79,7 +79,7 @@
# device {
# vendor "(COMPAQ|HP)"
# product "(MSA|HSV)1.0.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "1 hp-sw"
# path_selector "round-robin 0"
@@ -93,7 +93,7 @@
# device {
# vendor "HP"
# product "MSA VOLUME"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -123,7 +123,7 @@
# device {
# vendor "(COMPAQ|HP)"
# product "HSV1[01]1|HSV2[01]0|HSV300"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -138,7 +138,7 @@
# device {
# vendor "HP"
# product "MSA2[02]12*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -153,7 +153,7 @@
# device {
# vendor "HP"
# product "LOGICAL VOLUME.*"
-# getuid_callout "/lib/udev/scsi_id -n -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -n -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -168,7 +168,7 @@
# device {
# vendor "DDN"
# product "SAN DataDirector"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -181,7 +181,7 @@
# device {
# vendor "EMC"
# product "SYMMETRIX"
-# getuid_callout "/lib/udev/scsi_id -g -u -ppre-spc3-83 -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -ppre-spc3-83 -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -195,7 +195,7 @@
# vendor "DGC"
# product ".*"
# product_blacklist "LUNZ"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# prio_callout "/sbin/mpath_prio_emc /dev/%n"
# features "1 queue_if_no_path"
# hardware_handler "1 emc"
@@ -211,7 +211,7 @@
# device {
# vendor "FSC"
# product "CentricStor"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -224,7 +224,7 @@
# device {
# vendor "(HITACHI|HP)"
# product "OPEN-.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -237,7 +237,7 @@
# device {
# vendor "HITACHI"
# product "DF.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -251,7 +251,7 @@
# device {
# vendor "IBM"
# product "ProFibre 4000R"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -264,7 +264,7 @@
# device {
# vendor "IBM"
# product "1722-600"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -279,7 +279,7 @@
# device {
# vendor "IBM"
# product "1742"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -294,7 +294,7 @@
# device {
# vendor "IBM"
# product "1814"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -309,7 +309,7 @@
# device {
# vendor "IBM"
# product "1815"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -324,7 +324,7 @@
# device {
# vendor "IBM"
# product "3526"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -339,7 +339,7 @@
# device {
# vendor "IBM"
# product "3542"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -352,7 +352,7 @@
# device {
# vendor "IBM"
# product "2105(800|F20)"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -365,7 +365,7 @@
# device {
# vendor "IBM"
# product "1750500"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -379,7 +379,7 @@
# device {
# vendor "IBM"
# product "2107900"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -392,7 +392,7 @@
# device {
# vendor "IBM"
# product "2145"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -407,7 +407,7 @@
# vendor "IBM"
# product "S/390 DASD ECKD"
# product_blacklist "S/390.*"
-# getuid_callout "/sbin/dasdinfo -u -b %n"
+# getuid_callout "/sbin/dasd_id /dev/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -420,7 +420,7 @@
# device {
# vendor "NETAPP"
# product "LUN.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -434,7 +434,7 @@
# device {
# vendor "IBM"
# product "Nseries.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "1 queue_if_no_path"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -448,7 +448,7 @@
# device {
# vendor "Pillar"
# product "Axiom.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -461,7 +461,7 @@
# device {
# vendor "SGI"
# product "TP9[13]00"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -474,7 +474,7 @@
# device {
# vendor "SGI"
# product "TP9[45]00"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -489,7 +489,7 @@
# device {
# vendor "SGI"
# product "IS.*"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -504,7 +504,7 @@
# device {
# vendor "STK"
# product "OPENstorage D280"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -518,7 +518,7 @@
# device {
# vendor "SUN"
# product "(StorEdge 3510|T4)"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "0"
# path_selector "round-robin 0"
@@ -544,7 +544,7 @@
# device {
# vendor "SUN"
# product "CSM200_R"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -559,7 +559,7 @@
# device {
# vendor "SUN"
# product "LCSM100_F"
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# features "0"
# hardware_handler "1 rdac"
# path_selector "round-robin 0"
@@ -571,4 +571,18 @@
# path_checker rdac
# prio rdac
# }
+# device {
+# vendor "DELL"
+# product "MD3000"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
+# features "0"
+# hardware_handler "1 rdac"
+# path_selector "round-robin 0"
+# path_grouping_policy group_by_prio
+# failback manual
+# rr_weight uniform
+# rr_min_io 1000
+# path_checker rdac
+# prio rdac
+# }
#}
Index: multipath-tools-080519/multipath.conf.synthetic
===================================================================
--- multipath-tools-080519.orig/multipath.conf.synthetic
+++ multipath-tools-080519/multipath.conf.synthetic
@@ -7,7 +7,7 @@
# polling_interval 10
# selector "round-robin 0"
# path_grouping_policy multibus
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# prio const
# path_checker directio
# rr_min_io 100
@@ -52,7 +52,7 @@
# vendor "COMPAQ "
# product "HSV110 (C)COMPAQ"
# path_grouping_policy multibus
-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
# path_checker directio
# path_selector "round-robin 0"
# hardware_handler "0"
Index: multipath-tools-080519/Makefile.inc
===================================================================
--- multipath-tools-080519.orig/Makefile.inc
+++ multipath-tools-080519/Makefile.inc
@@ -20,7 +20,7 @@ libudevdir = ${prefix}/lib/udev
multipathdir = $(TOPDIR)/libmultipath
mandir = $(prefix)/usr/share/man/man8
man5dir = $(prefix)/usr/share/man/man5
-rcdir = $(prefix)/etc/init.d
+rcdir = $(prefix)/etc/rc.d/init.d
libdir = $(prefix)/lib/multipath
GZIP = /bin/gzip -9 -c
Index: multipath-tools-080519/multipathd/Makefile
===================================================================
--- multipath-tools-080519.orig/multipathd/Makefile
+++ multipath-tools-080519/multipathd/Makefile
@@ -35,6 +35,7 @@ install:
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(rcdir)
+ $(INSTALL_PROGRAM) -m 755 multipathd.init.redhat $(DESTDIR)$(rcdir)/$(EXEC)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
Index: multipath-tools-080519/multipathd/multipathd.init.redhat
===================================================================
--- multipath-tools-080519.orig/multipathd/multipathd.init.redhat
+++ multipath-tools-080519/multipathd/multipathd.init.redhat
@@ -1,13 +1,9 @@
#!/bin/bash
-
-#
-# /etc/rc.d/init.d/multipathd
#
-# Starts the multipath daemon
+# multipathd Starts the multipath daemon
#
# chkconfig: - 13 87
-# description: Manage device-mapper multipath devices
-# processname: multipathd
+# description: Manages device-mapper multipath devices
DAEMON=/sbin/multipathd
prog=`basename $DAEMON`
@@ -16,14 +12,8 @@ lockdir=/var/lock/subsys
sysconfig=/etc/sysconfig
-system=redhat
-
-if [ $system = redhat ]; then
- # Source function library.
- . $initdir/functions
-fi
+. $initdir/functions
-test -x $DAEMON || exit 0
test -r $sysconfig/$prog && . $sysconfig/$prog
RETVAL=0
@@ -33,6 +23,7 @@ RETVAL=0
#
start() {
+ test -x $DAEMON || exit 5
echo -n $"Starting $prog daemon: "
daemon $DAEMON
RETVAL=$?
@@ -74,7 +65,7 @@ reload)
restart)
restart
;;
-condrestart)
+condrestart|try-restart)
if [ -f $lockdir/$prog ]; then
restart
fi
@@ -85,7 +76,7 @@ status)
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- RETVAL=1
+ RETVAL=2
esac
exit $RETVAL
Index: multipath-tools-080519/multipath/Makefile
===================================================================
--- multipath-tools-080519.orig/multipath/Makefile
+++ multipath-tools-080519/multipath/Makefile
@@ -28,6 +28,10 @@ install:
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir)
+ if [ ! -e $(DESTDIR)//etc/multipath.conf ]; then \
+ $(INSTALL_PROGRAM) -m 644 multipath.conf.redhat $(DESTDIR)/etc/multipath.conf; \
+ fi
+ $(INSTALL_PROGRAM) -d $(DESTDIR)/var/lib/multipath
uninstall:
rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
Index: multipath-tools-080519/multipath/multipath.conf.redhat
===================================================================
--- /dev/null
+++ multipath-tools-080519/multipath/multipath.conf.redhat
@@ -0,0 +1,97 @@
+# This is a basic configuration file with some examples, for device mapper
+# multipath.
+# For a complete list of the default configuration values, see
+# /usr/share/doc/device-mapper-multipath-0.4.8/multipath.conf.defaults
+# For a list of configuration options with descriptions, see
+# /usr/share/doc/device-mapper-multipath-0.4.8/multipath.conf.annotated
+
+
+# Blacklist all devices by default. Remove this to enable multipathing
+# on the default devices.
+blacklist {
+ devnode "*"
+}
+
+## By default, devices with vendor = "IBM" and product = "S/390.*" are
+## blacklisted. To enable mulitpathing on these devies, uncomment the
+## following lines.
+#blacklist_exceptions {
+# device {
+# vendor "IBM"
+# product "S/390.*"
+# }
+#}
+
+## Use user friendly names, instead of using WWIDs as names.
+defaults {
+ user_friendly_names yes
+}
+##
+## Here is an example of how to configure some standard options.
+##
+#
+#defaults {
+# udev_dir /dev
+# polling_interval 10
+# selector "round-robin 0"
+# path_grouping_policy multibus
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
+# prio alua
+# path_checker readsector0
+# rr_min_io 100
+# max_fds 8192
+# rr_weight priorities
+# failback immediate
+# no_path_retry fail
+# user_friendly_names yes
+#}
+##
+## The wwid line in the following blacklist section is shown as an example
+## of how to blacklist devices by wwid. The 2 devnode lines are the
+## compiled in default blacklist. If you want to blacklist entire types
+## of devices, such as all scsi devices, you should use a devnode line.
+## However, if you want to blacklist specific devices, you should use
+## a wwid line. Since there is no guarantee that a specific device will
+## not change names on reboot (from /dev/sda to /dev/sdb for example)
+## devnode lines are not recommended for blacklisting specific devices.
+##
+#blacklist {
+# wwid 26353900f02796769
+# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
+# devnode "^hd[a-z]"
+#}
+#multipaths {
+# multipath {
+# wwid 3600508b4000156d700012000000b0000
+# alias yellow
+# path_grouping_policy multibus
+# path_checker readsector0
+# path_selector "round-robin 0"
+# failback manual
+# rr_weight priorities
+# no_path_retry 5
+# }
+# multipath {
+# wwid 1DEC_____321816758474
+# alias red
+# }
+#}
+#devices {
+# device {
+# vendor "COMPAQ "
+# product "HSV110 (C)COMPAQ"
+# path_grouping_policy multibus
+# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
+# path_checker readsector0
+# path_selector "round-robin 0"
+# hardware_handler "0"
+# failback 15
+# rr_weight priorities
+# no_path_retry queue
+# }
+# device {
+# vendor "COMPAQ "
+# product "MSA1000 "
+# path_grouping_policy multibus
+# }
+#}
Index: multipath-tools-080519/kpartx/Makefile
===================================================================
--- multipath-tools-080519.orig/kpartx/Makefile
+++ multipath-tools-080519/kpartx/Makefile
@@ -20,10 +20,10 @@ $(EXEC): $(OBJS)
install: $(EXEC) $(EXEC).8
$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)
- $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir)
- $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
- $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/
+# $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)
+# $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir)
+# $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
+# $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/
$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)

View File

@ -1 +1 @@
0199270b9e36468f096bfd81cf439930 multipath-tools-0.4.7.head2.tgz 30b9482582f73c7c8e1bf8d816d30bbf multipath-tools-080519.tgz

View File

@ -1,6 +1,7 @@
diff -up multipath-tools-0.4.7.head2/kpartx/lopart.c.BAD multipath-tools-0.4.7.head2/kpartx/lopart.c Index: multipath-tools-080515/kpartx/lopart.c
--- multipath-tools-0.4.7.head2/kpartx/lopart.c.BAD 2008-02-29 13:35:19.000000000 -0500 ===================================================================
+++ multipath-tools-0.4.7.head2/kpartx/lopart.c 2008-02-29 13:36:44.000000000 -0500 --- multipath-tools-080515.orig/kpartx/lopart.c
+++ multipath-tools-080515/kpartx/lopart.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
#if defined(__hppa__) || defined(__powerpc64__) || defined (__alpha__) \ #if defined(__hppa__) || defined(__powerpc64__) || defined (__alpha__) \
|| defined (__x86_64__) || defined (__x86_64__)

28
uevent_fix.patch Normal file
View File

@ -0,0 +1,28 @@
Index: multipath-tools-080515/multipathd/main.c
===================================================================
--- multipath-tools-080515.orig/multipathd/main.c
+++ multipath-tools-080515/multipathd/main.c
@@ -619,14 +619,20 @@ uxsock_trigger (char * str, char ** repl
static int
uev_discard(char * devpath)
{
+ char *tmp;
char a[10], b[10];
/*
* keep only block devices, discard partitions
*/
- if (sscanf(devpath, "/block/%10s", a) != 1 ||
- sscanf(devpath, "/block/%10[^/]/%10s", a, b) == 2) {
- condlog(4, "discard event on %s", devpath);
+ tmp = strstr(devpath, "/block/");
+ if (tmp == NULL){
+ condlog(0, "no /block/ in '%s'", devpath);
+ return 1;
+ }
+ if (sscanf(tmp, "/block/%10s", a) != 1 ||
+ sscanf(tmp, "/block/%10[^/]/%10s", a, b) == 2) {
+ condlog(0, "discard event on %s", devpath);
return 1;
}
return 0;