From c7ea1a3b8dbfdeb2020d25e5d847a1bb8513081f Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Wed, 29 Jul 2009 22:54:07 +0000 Subject: [PATCH] Updated to latest upstream 0.4.9 code : multipath-tools-090729.tgz (git commit id: d678c139719d5631194b50e49f16ca97162ecd0f) moved multipath bindings file from /var/lib/multipath to /etc/multipath Fixed 354961, 432520 --- .cvsignore | 2 +- binding_error.patch | 13 --- bindings_file.patch | 172 +++++++++++++++++++++++++++++++ cciss_id.patch | 58 ++++++----- device-mapper-multipath.spec | 60 +++++++---- directio_message_cleanup.patch | 10 +- fix_kpartx.patch | 12 ++- fix_missed_uevs.patch | 26 +++++ lib64_multipath.patch | 41 +++++++- log_all_messages.patch | 13 +++ move_bindings.patch | 38 +++++++ mpath_wait.patch | 22 ++-- multipath_rules.patch | 26 +++-- path_checker.patch | 181 +++++++++++++++++++++++++++++++++ queue_without_daemon.patch | 153 ++++++++++++++++++++++++++++ redhatification.patch | 59 +++++++++-- root_init_script.patch | 70 +++++++++++++ sources | 2 +- stop_warnings.patch | 24 +++++ uninstall.patch | 26 +++++ 20 files changed, 903 insertions(+), 105 deletions(-) delete mode 100644 binding_error.patch create mode 100644 bindings_file.patch create mode 100644 fix_missed_uevs.patch create mode 100644 log_all_messages.patch create mode 100644 move_bindings.patch create mode 100644 path_checker.patch create mode 100644 queue_without_daemon.patch create mode 100644 root_init_script.patch create mode 100644 stop_warnings.patch create mode 100644 uninstall.patch diff --git a/.cvsignore b/.cvsignore index f42f02b..0d7064b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -multipath-tools-090429.tgz +multipath-tools-090729.tgz diff --git a/binding_error.patch b/binding_error.patch deleted file mode 100644 index abd9811..0000000 --- a/binding_error.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: multipath-tools/libmultipath/alias.c -=================================================================== ---- multipath-tools.orig/libmultipath/alias.c -+++ multipath-tools/libmultipath/alias.c -@@ -243,7 +243,7 @@ lookup_binding(FILE *f, char *map_wwid, - curr_id = scan_devname(alias); - if (curr_id >= id) - id = curr_id + 1; -- wwid = strtok(NULL, " \t"); -+ wwid = strtok(NULL, ""); - if (!wwid){ - condlog(3, - "Ignoring malformed line %u in bindings file", diff --git a/bindings_file.patch b/bindings_file.patch new file mode 100644 index 0000000..209ad61 --- /dev/null +++ b/bindings_file.patch @@ -0,0 +1,172 @@ +Add the ability to change the location of the user_friendly_names +binding file. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/config.c | 11 ++++++++--- + libmultipath/dict.c | 24 ++++++++++++++++++++++++ + multipath.conf.annotated | 9 +++++++++ + multipath.conf.defaults | 1 + + multipath/main.c | 4 +++- + multipath/multipath.conf.5 | 8 ++++++-- + 6 files changed, 51 insertions(+), 6 deletions(-) + +Index: multipath-tools-090513/libmultipath/config.c +=================================================================== +--- multipath-tools-090513.orig/libmultipath/config.c ++++ multipath-tools-090513/libmultipath/config.c +@@ -405,6 +405,9 @@ free_config (struct config * conf) + if (conf->checker_name) + FREE(conf->checker_name); + ++ if (conf->bindings_file) ++ FREE(conf->bindings_file); ++ + free_blacklist(conf->blist_devnode); + free_blacklist(conf->blist_wwid); + free_blacklist_device(conf->blist_device); +@@ -437,7 +440,6 @@ load_config (char * file) + conf->dev_type = DEV_NONE; + conf->minio = 1000; + conf->max_fds = 0; +- conf->bindings_file = DEFAULT_BINDINGS_FILE; + conf->multipath_dir = set_default(DEFAULT_MULTIPATHDIR); + conf->flush_on_last_del = 0; + conf->attribute_flags = 0; +@@ -535,9 +537,12 @@ load_config (char * file) + if (conf->hwhandler == NULL) + conf->hwhandler = set_default(DEFAULT_HWHANDLER); + ++ if (conf->bindings_file == NULL) ++ conf->bindings_file = set_default(DEFAULT_BINDINGS_FILE); ++ + if (!conf->selector || !conf->udev_dir || !conf->multipath_dir || +- !conf->getuid || !conf->features || +- !conf->hwhandler) ++ !conf->getuid || !conf->features || !conf->hwhandler || ++ !conf->bindings_file) + goto out; + + if (!conf->prio_name) +Index: multipath-tools-090513/libmultipath/dict.c +=================================================================== +--- multipath-tools-090513.orig/libmultipath/dict.c ++++ multipath-tools-090513/libmultipath/dict.c +@@ -423,6 +423,17 @@ names_handler(vector strvec) + return 0; + } + ++static int ++def_bindings_file_handler(vector strvec) ++{ ++ conf->bindings_file = set_value(strvec); ++ ++ if (!conf->bindings_file) ++ return 1; ++ ++ return 0; ++} ++ + /* + * blacklist block handlers + */ +@@ -1920,6 +1931,18 @@ snprint_def_user_friendly_names (char * + } + + static int ++snprint_def_bindings_file(char * buff, int len, void * data) ++{ ++ if (conf->bindings_file == NULL) ++ return 0; ++ if (strlen(conf->bindings_file) == strlen(DEFAULT_BINDINGS_FILE) && ++ !strcmp(conf->bindings_file, DEFAULT_BINDINGS_FILE)) ++ return 0; ++ ++ return snprintf(buff, len, "%s", conf->bindings_file); ++} ++ ++static int + snprint_ble_simple (char * buff, int len, void * data) + { + struct blentry * ble = (struct blentry *)data; +@@ -1969,6 +1992,7 @@ init_keywords(void) + install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout); + install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del); + install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names); ++ install_keyword("bindings_file", &def_bindings_file_handler, &snprint_def_bindings_file); + install_keyword("mode", &def_mode_handler, &snprint_def_mode); + install_keyword("uid", &def_uid_handler, &snprint_def_uid); + install_keyword("gid", &def_gid_handler, &snprint_def_gid); +Index: multipath-tools-090513/multipath.conf.annotated +=================================================================== +--- multipath-tools-090513.orig/multipath.conf.annotated ++++ multipath-tools-090513/multipath.conf.annotated +@@ -198,6 +198,15 @@ + # # default : determined by the process + # gid disk + # ++# # ++# # name : bindings_file ++# # scope : multipath ++# # desc : The location of the bindings file that is used with ++# the user_friendly_names option ++# # values : ++# # default : "/var/lib/multipath/bindings" ++# bindings_file "/etc/multipath_bindings" ++# + #} + # + ## +Index: multipath-tools-090513/multipath.conf.defaults +=================================================================== +--- multipath-tools-090513.orig/multipath.conf.defaults ++++ multipath-tools-090513/multipath.conf.defaults +@@ -14,6 +14,7 @@ + # failback manual + # no_path_retry fail + # user_friendly_names no ++# bindings_file "/var/lib/multipath/bindings" + #} + # + #blacklist { +Index: multipath-tools-090513/multipath/main.c +=================================================================== +--- multipath-tools-090513.orig/multipath/main.c ++++ multipath-tools-090513/multipath/main.c +@@ -362,7 +362,9 @@ main (int argc, char *argv[]) + conf->verbosity = atoi(optarg); + break; + case 'b': +- conf->bindings_file = optarg; ++ if (conf->bindings_file) ++ FREE(conf->bindings_file); ++ conf->bindings_file = STRDUP(optarg); + break; + case 'd': + conf->dry_run = 1; +Index: multipath-tools-090513/multipath/multipath.conf.5 +=================================================================== +--- multipath-tools-090513.orig/multipath/multipath.conf.5 ++++ multipath-tools-090513/multipath/multipath.conf.5 +@@ -221,8 +221,7 @@ for never stop queueing. Default is 0. + .B user_friendly_names + If set to + .I yes +-, using the bindings file +-.I /var/lib/multipath/bindings ++, using the bindings file (by default \fI/var/lib/multipath/bindings\fR) + to assign a persistent and unique alias to the multipath, in the form of mpath. + If set to + .I no +@@ -231,6 +230,11 @@ be overriden by any specific aliases in + Default is + .I no + .TP ++.B bindings_file ++Specify the location of the bindings file used by the user_friendly_names ++option. Default is ++.I /var/lib/multipath/bindings ++.TP + .B max_fds + Specify the maximum number of file descriptors that can be opened by multipath + and multipathd. This is equivalent to ulimit -n. A value of \fImax\fR will set diff --git a/cciss_id.patch b/cciss_id.patch index a84c650..f8344ae 100644 --- a/cciss_id.patch +++ b/cciss_id.patch @@ -1,7 +1,13 @@ -Index: multipath-tools-080519/cciss_id/cciss_id.c +--- + Makefile | 3 - + cciss_id/Makefile | 47 +++++++++++++++++++ + cciss_id/cciss_id.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 177 insertions(+), 1 deletion(-) + +Index: multipath-tools-090724/cciss_id/cciss_id.c =================================================================== --- /dev/null -+++ multipath-tools-080519/cciss_id/cciss_id.c ++++ multipath-tools-090724/cciss_id/cciss_id.c @@ -0,0 +1,128 @@ +/* + ***************************************************************************** @@ -31,11 +37,11 @@ Index: multipath-tools-080519/cciss_id/cciss_id.c +#include +#include +#include -+#include -+#include -+#include -+#include -+#include ++#include ++#include ++#include ++#include ++#include +#include + +#include @@ -45,13 +51,13 @@ Index: multipath-tools-080519/cciss_id/cciss_id.c +#define PATH_CCISSDEV "/dev/cciss/" /* Path of CCISS devices */ +int main(int argc, char *argv[]) +{ -+ const int resp_len = LEN_PAGE83_CCISSDEV; ++ 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 + @@ -59,26 +65,26 @@ Index: multipath-tools-080519/cciss_id/cciss_id.c + 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); -+ } ++ 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); ++ 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); @@ -96,15 +102,15 @@ Index: multipath-tools-080519/cciss_id/cciss_id.c + 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.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.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[2] = 0x83; + cic.Request.CDB[4] = resp_len & 0xFF; + cic.buf_size = resp_len; + cic.buf = resp; @@ -124,17 +130,17 @@ Index: multipath-tools-080519/cciss_id/cciss_id.c + printf("3"); + for(i=8; i<24; i++) + /* printf("Buff[%d] =%x\n", i, resp[i]); */ -+ printf("%02x", resp[i]); ++ printf("%02x", resp[i]); + printf("\n"); + } -+ ++ + close(fd); + return 0; +} -Index: multipath-tools-080519/cciss_id/Makefile +Index: multipath-tools-090724/cciss_id/Makefile =================================================================== --- /dev/null -+++ multipath-tools-080519/cciss_id/Makefile ++++ multipath-tools-090724/cciss_id/Makefile @@ -0,0 +1,47 @@ + +# ***************************************************************************** @@ -183,10 +189,10 @@ Index: multipath-tools-080519/cciss_id/Makefile + +clean: + rm -f core.* *.o $(EXEC) *.gz -Index: multipath-tools-080519/Makefile +Index: multipath-tools-090724/Makefile =================================================================== ---- multipath-tools-080519.orig/Makefile -+++ multipath-tools-080519/Makefile +--- multipath-tools-090724.orig/Makefile ++++ multipath-tools-090724/Makefile @@ -25,7 +25,8 @@ BUILDDIRS = \ libmultipath/checkers \ multipath \ diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index 61b2878..89e41c1 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,20 +1,27 @@ Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.4.9 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL+ Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ -Source0: multipath-tools-090429.tgz -Patch0: lib64_multipath.patch -Patch1: redhatification.patch -Patch2: mpath_wait.patch -Patch3: multipath_rules.patch -Patch4: cciss_id.patch -Patch5: directio_message_cleanup.patch -Patch6: binding_error.patch -Patch7: fix_kpartx.patch +Source0: multipath-tools-090729.tgz +Patch0: fix_missed_uevs.patch +Patch1: log_all_messages.patch +Patch2: queue_without_daemon.patch +Patch3: path_checker.patch +Patch4: root_init_script.patch +Patch5: uninstall.patch +Patch6: lib64_multipath.patch +Patch7: directio_message_cleanup.patch +Patch8: fix_kpartx.patch +Patch9: redhatification.patch +Patch10: mpath_wait.patch +Patch11: multipath_rules.patch +Patch12: cciss_id.patch +Patch13: stop_warnings.patch +Patch14: move_bindings.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{name}-libs = %{version}-%{release} @@ -54,16 +61,23 @@ kpartx manages partition creation and removal for device-mapper devices. %prep %setup -q -n multipath-tools +%patch0 -p1 -b .fix_missed_uevs +%patch1 -p1 -b .log_all_messages +%patch2 -p1 -b .queue_without_daemon +%patch3 -p1 -b .path_checker +%patch4 -p1 -b .root_init_script +%patch5 -p1 -b .uninstall.patch %if %{_lib} == "lib64" -%patch0 -p1 -b .lib64_multipath +%patch6 -p1 -b .lib64_multipath %endif -%patch1 -p1 -b .redhatification -%patch2 -p1 -b .mpath_wait -%patch3 -p1 -b .multipath_rules -%patch4 -p1 -b .cciss_id -%patch5 -p1 -b .directio_message -%patch6 -p1 -b .binding_error -%patch7 -p1 -b .fix_kpartx +%patch7 -p1 -b .directio_message_cleanup +%patch8 -p1 -b .fix_kpartx +%patch9 -p1 -b .redhatification +%patch10 -p1 -b .mpath_wait +%patch11 -p1 -b .multipath_rules +%patch12 -p1 -b .cciss_id +%patch13 -p1 -b .stop_warnings +%patch14 -p1 -b .move_bindings %build %define _sbindir /sbin @@ -76,7 +90,7 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT bindir=%{_sbindir} syslibdir=%{_libdir} libdir=%{_libmpathdir} rcdir=%{_initrddir} install -m 0644 multipath/multipath.conf.redhat $RPM_BUILD_ROOT/etc/multipath.conf install -m 0755 multipathd/multipathd.init.redhat $RPM_BUILD_ROOT/%{_initrddir}/multipathd -install -d $RPM_BUILD_ROOT/var/lib/multipath +install -d $RPM_BUILD_ROOT/etc/multipath %clean rm -rf $RPM_BUILD_ROOT @@ -110,7 +124,7 @@ fi %config /etc/udev/rules.d/40-multipath.rules %config(noreplace) /etc/multipath.conf %doc AUTHOR COPYING README* FAQ multipath.conf.annotated multipath.conf.defaults multipath.conf.synthetic -%dir /var/lib/multipath +%dir /etc/multipath %files libs %defattr(-,root,root,-) @@ -124,6 +138,12 @@ fi %{_mandir}/man8/kpartx.8.gz %changelog +* Wed Jul 29 2009 Benjamin Marzinski - 0.4.9-3 +- Updated to latest upstream 0.4.9 code : multipath-tools-090729.tgz + (git commit id: d678c139719d5631194b50e49f16ca97162ecd0f) +- moved multipath bindings file from /var/lib/multipath to /etc/multipath +- Fixed 354961, 432520 + * Fri Jul 24 2009 Fedora Release Engineering - 0.4.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild diff --git a/directio_message_cleanup.patch b/directio_message_cleanup.patch index c507d97..8fb9397 100644 --- a/directio_message_cleanup.patch +++ b/directio_message_cleanup.patch @@ -1,8 +1,8 @@ -diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c -index 4728424..7624c4e 100644 ---- a/libmultipath/checkers/directio.c -+++ b/libmultipath/checkers/directio.c -@@ -148,10 +148,11 @@ check_state(int fd, struct directio_context *ct, int sync) +Index: multipath-tools-090724/libmultipath/checkers/directio.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/checkers/directio.c ++++ multipath-tools-090724/libmultipath/checkers/directio.c +@@ -148,10 +148,11 @@ check_state(int fd, struct directio_cont } ct->running++; diff --git a/fix_kpartx.patch b/fix_kpartx.patch index 8d12bc3..9d74354 100644 --- a/fix_kpartx.patch +++ b/fix_kpartx.patch @@ -1,6 +1,8 @@ ---- multipath-tools.old/kpartx/kpartx.c 2008-07-23 22:49:52.000000000 +0200 -+++ multipath-tools/kpartx/kpartx.c 2009-03-06 13:32:49.000000000 +0100 -@@ -474,6 +474,7 @@ main(int argc, char **argv){ +Index: multipath-tools-090724/kpartx/kpartx.c +=================================================================== +--- multipath-tools-090724.orig/kpartx/kpartx.c ++++ multipath-tools-090724/kpartx/kpartx.c +@@ -489,6 +489,7 @@ main(int argc, char **argv){ d = c; while (c) { for (j = 0; j < n; j++) { @@ -8,7 +10,7 @@ int k = slices[j].container - 1; if (slices[j].size == 0) -@@ -484,7 +485,7 @@ main(int argc, char **argv){ +@@ -499,7 +500,7 @@ main(int argc, char **argv){ continue; /* Skip all simple slices */ @@ -17,7 +19,7 @@ continue; /* Check container slice */ -@@ -499,10 +500,11 @@ main(int argc, char **argv){ +@@ -514,10 +515,11 @@ main(int argc, char **argv){ } strip_slash(partname); diff --git a/fix_missed_uevs.patch b/fix_missed_uevs.patch new file mode 100644 index 0000000..c614aa2 --- /dev/null +++ b/fix_missed_uevs.patch @@ -0,0 +1,26 @@ +Index: multipath-tools-090724/libmultipath/uevent.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/uevent.c ++++ multipath-tools-090724/libmultipath/uevent.c +@@ -231,7 +231,8 @@ int uevent_listen(int (*uev_trigger)(str + smsg.msg_control = cred_msg; + smsg.msg_controllen = sizeof(cred_msg); + +- if (recvmsg(sock, &smsg, 0) < 0) { ++ buflen = recvmsg(sock, &smsg, 0); ++ if (buflen < 0) { + if (errno != EINTR) + condlog(0, "error receiving message"); + continue; +@@ -286,8 +287,10 @@ int uevent_listen(int (*uev_trigger)(str + /* action string */ + uev->action = buffer; + pos = strchr(buffer, '@'); +- if (!pos) ++ if (!pos) { ++ condlog(3, "bad action string '%s'", buffer); + continue; ++ } + pos[0] = '\0'; + + /* sysfs path */ diff --git a/lib64_multipath.patch b/lib64_multipath.patch index ebd22ed..b6077d5 100644 --- a/lib64_multipath.patch +++ b/lib64_multipath.patch @@ -1,12 +1,43 @@ -diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index d7f93cb..357c519 100644 ---- a/libmultipath/defaults.h -+++ b/libmultipath/defaults.h +Index: multipath-tools-090724/libmultipath/defaults.h +=================================================================== +--- multipath-tools-090724.orig/libmultipath/defaults.h ++++ multipath-tools-090724/libmultipath/defaults.h @@ -1,6 +1,6 @@ #define DEFAULT_GETUID "/lib/udev/scsi_id --whitelisted --device=/dev/%n" #define DEFAULT_UDEVDIR "/dev" -#define DEFAULT_MULTIPATHDIR "/lib/multipath" -+#define DEFAULT_MULTIPATHDIR "/lib64/multipath" ++#define DEFAULT_MULTIPATHDIR "/" LIB_STRING "/multipath" #define DEFAULT_SELECTOR "round-robin 0" #define DEFAULT_FEATURES "0" #define DEFAULT_HWHANDLER "0" +Index: multipath-tools-090724/Makefile.inc +=================================================================== +--- multipath-tools-090724.orig/Makefile.inc ++++ multipath-tools-090724/Makefile.inc +@@ -13,6 +13,8 @@ ifeq ($(TOPDIR),) + TOPDIR = .. + endif + ++ LIB=lib64 ++ + prefix = + exec_prefix = $(prefix) + bindir = $(exec_prefix)/sbin +@@ -21,14 +23,14 @@ multipathdir = $(TOPDIR)/libmultipath + mandir = $(prefix)/usr/share/man/man8 + man5dir = $(prefix)/usr/share/man/man5 + rcdir = $(prefix)/etc/init.d +-syslibdir = $(prefix)/lib +-libdir = $(prefix)/lib/multipath ++syslibdir = $(prefix)/$(LIB) ++libdir = $(prefix)/$(LIB)/multipath + + GZIP = /bin/gzip -9 -c + INSTALL_PROGRAM = install + + OPTFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes +-CFLAGS = $(OPTFLAGS) -fPIC ++CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" + SHARED_FLAGS = -shared + + %.o: %.c diff --git a/log_all_messages.patch b/log_all_messages.patch new file mode 100644 index 0000000..056603c --- /dev/null +++ b/log_all_messages.patch @@ -0,0 +1,13 @@ +Index: multipath-tools-090724/libmultipath/log.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/log.c ++++ multipath-tools-090724/libmultipath/log.c +@@ -181,7 +181,7 @@ int log_dequeue (void * buff) + + memset((void *)src, 0, len); + +- return la->empty; ++ return 0; + } + + /* diff --git a/move_bindings.patch b/move_bindings.patch new file mode 100644 index 0000000..eb683f5 --- /dev/null +++ b/move_bindings.patch @@ -0,0 +1,38 @@ +Index: multipath-tools-090724/libmultipath/defaults.h +=================================================================== +--- multipath-tools-090724.orig/libmultipath/defaults.h ++++ multipath-tools-090724/libmultipath/defaults.h +@@ -19,6 +19,6 @@ + #define DEFAULT_PIDFILE "/var/run/multipathd.pid" + #define DEFAULT_SOCKET "/var/run/multipathd.sock" + #define DEFAULT_CONFIGFILE "/etc/multipath.conf" +-#define DEFAULT_BINDINGS_FILE "/var/lib/multipath/bindings" ++#define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" + + char * set_default (char * str); +Index: multipath-tools-090724/multipath.conf.annotated +=================================================================== +--- multipath-tools-090724.orig/multipath.conf.annotated ++++ multipath-tools-090724/multipath.conf.annotated +@@ -163,7 +163,7 @@ + # # name : user_friendly_names + # # scope : multipath + # # desc : If set to "yes", using the bindings file +-# # /var/lib/multipath/bindings to assign a persistent and ++# # /etc/multipath/bindings to assign a persistent and + # # unique alias to the multipath, in the form of mpath. + # # If set to "no" use the WWID as the alias. In either case + # # this be will be overriden by any specific aliases in this +Index: multipath-tools-090724/multipath/multipath.conf.5 +=================================================================== +--- multipath-tools-090724.orig/multipath/multipath.conf.5 ++++ multipath-tools-090724/multipath/multipath.conf.5 +@@ -222,7 +222,7 @@ for never stop queueing. Default is 0. + If set to + .I yes + , using the bindings file +-.I /var/lib/multipath/bindings ++.I /etc/multipath/bindings + to assign a persistent and unique alias to the multipath, in the form of mpath. + If set to + .I no diff --git a/mpath_wait.patch b/mpath_wait.patch index 44e14d7..7d61c9c 100644 --- a/mpath_wait.patch +++ b/mpath_wait.patch @@ -1,7 +1,12 @@ -diff --git a/multipath/Makefile b/multipath/Makefile -index e0031a2..fe377d8 100644 ---- a/multipath/Makefile -+++ b/multipath/Makefile +--- + multipath/Makefile | 3 ++- + multipath/mpath_wait | 17 +++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +Index: multipath-tools-090724/multipath/Makefile +=================================================================== +--- multipath-tools-090724.orig/multipath/Makefile ++++ multipath-tools-090724/multipath/Makefile @@ -20,7 +20,7 @@ $(EXEC): $(OBJS) install: @@ -11,7 +16,7 @@ index e0031a2..fe377d8 100644 $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d $(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/ $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) -@@ -31,6 +31,7 @@ install: +@@ -34,6 +34,7 @@ install: uninstall: rm $(DESTDIR)/etc/udev/rules.d/multipath.rules rm $(DESTDIR)$(bindir)/$(EXEC) @@ -19,11 +24,10 @@ index e0031a2..fe377d8 100644 rm $(DESTDIR)$(mandir)/$(EXEC).8.gz rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz -diff --git a/multipath/mpath_wait b/multipath/mpath_wait -new file mode 100644 -index 0000000..d4047cc +Index: multipath-tools-090724/multipath/mpath_wait +=================================================================== --- /dev/null -+++ b/multipath/mpath_wait ++++ multipath-tools-090724/multipath/mpath_wait @@ -0,0 +1,17 @@ +#!/bin/bash + diff --git a/multipath_rules.patch b/multipath_rules.patch index 6cdd4bc..44b9e1e 100644 --- a/multipath_rules.patch +++ b/multipath_rules.patch @@ -1,8 +1,13 @@ -diff --git a/multipath/Makefile b/multipath/Makefile -index fe377d8..b2c4fa6 100644 ---- a/multipath/Makefile -+++ b/multipath/Makefile -@@ -22,14 +22,14 @@ install: +--- + multipath/Makefile | 4 ++-- + multipath/multipath.rules | 13 +++++++------ + 2 files changed, 9 insertions(+), 8 deletions(-) + +Index: multipath-tools-090724/multipath/Makefile +=================================================================== +--- multipath-tools-090724.orig/multipath/Makefile ++++ multipath-tools-090724/multipath/Makefile +@@ -22,7 +22,7 @@ install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) -m 755 $(EXEC) mpath_wait $(DESTDIR)$(bindir)/ $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d @@ -11,7 +16,8 @@ index fe377d8..b2c4fa6 100644 $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir) $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir) $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) - $(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir) +@@ -32,7 +32,7 @@ install: + fi uninstall: - rm $(DESTDIR)/etc/udev/rules.d/multipath.rules @@ -19,10 +25,10 @@ index fe377d8..b2c4fa6 100644 rm $(DESTDIR)$(bindir)/$(EXEC) rm $(DESTDIR)$(bindir)/mpath_wait rm $(DESTDIR)$(mandir)/$(EXEC).8.gz -diff --git a/multipath/multipath.rules b/multipath/multipath.rules -index ac97749..ad2ff2a 100644 ---- a/multipath/multipath.rules -+++ b/multipath/multipath.rules +Index: multipath-tools-090724/multipath/multipath.rules +=================================================================== +--- multipath-tools-090724.orig/multipath/multipath.rules ++++ multipath-tools-090724/multipath/multipath.rules @@ -1,7 +1,8 @@ -# -# udev rules for multipathing. diff --git a/path_checker.patch b/path_checker.patch new file mode 100644 index 0000000..970f735 --- /dev/null +++ b/path_checker.patch @@ -0,0 +1,181 @@ +Index: multipath-tools-090724/libmultipath/checkers/tur.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/checkers/tur.c ++++ multipath-tools-090724/libmultipath/checkers/tur.c +@@ -69,7 +69,6 @@ libcheck_check (struct checker * c) + case DID_NO_CONNECT: + case DID_BAD_TARGET: + case DID_ABORT: +- case DID_TRANSPORT_DISRUPTED: + case DID_TRANSPORT_FAILFAST: + break; + default: +Index: multipath-tools-090724/libmultipath/discovery.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/discovery.c ++++ multipath-tools-090724/libmultipath/discovery.c +@@ -579,10 +579,9 @@ struct sysfs_device *sysfs_device_from_p + } + + int +-path_offline (struct path * pp) ++path_state (struct path * pp, char * buff) + { + struct sysfs_device * parent; +- char buff[SCSI_STATE_SIZE]; + + pp->sysdev = sysfs_device_from_path(pp); + if (!pp->sysdev) { +@@ -604,6 +603,16 @@ path_offline (struct path * pp) + return 1; + + condlog(3, "%s: state = %s", pp->dev, buff); ++ return 0; ++} ++ ++int ++path_offline (struct path * pp) ++{ ++ char buff[SCSI_STATE_SIZE]; ++ ++ if (path_state(pp, buff)) ++ return 1; + + if (!strncmp(buff, "offline", 7)) { + pp->offline = 1; +@@ -613,6 +622,21 @@ path_offline (struct path * pp) + return 0; + } + ++int ++path_blocked (struct path * pp) ++{ ++ char buff[SCSI_STATE_SIZE]; ++ ++ if (pp->bus != SYSFS_BUS_SCSI) ++ return 0; ++ if (path_state(pp, buff)) ++ return 0; ++ if (!strncmp(buff, "blocked", 7)) { ++ return 1; ++ } ++ return 0; ++} ++ + extern int + sysfs_pathinfo(struct path * pp) + { +@@ -699,36 +723,43 @@ cciss_ioctl_pathinfo (struct path * pp, + return 0; + } + +-static int +-get_state (struct path * pp) ++int ++get_state (struct path * pp, int daemon) + { + struct checker * c = &pp->checker; ++ int state; + + condlog(3, "%s: get_state", pp->dev); + + if (!checker_selected(c)) { ++ if (daemon) ++ pathinfo(pp, conf->hwtable, DI_SYSFS); + select_checker(pp); + if (!checker_selected(c)) { + condlog(3, "%s: No checker selected", pp->dev); +- return 1; ++ return PATH_UNCHECKED; + } + checker_set_fd(c, pp->fd); + if (checker_init(c, pp->mpp?&pp->mpp->mpcontext:NULL)) { + condlog(3, "%s: checker init failed", pp->dev); +- return 1; ++ return PATH_UNCHECKED; + } + } + if (path_offline(pp)) { + condlog(3, "%s: path offline", pp->dev); +- pp->state = PATH_DOWN; +- return 0; ++ return PATH_DOWN; + } +- pp->state = checker_check(c); +- condlog(3, "%s: state = %i", pp->dev, pp->state); +- if (pp->state == PATH_DOWN && strlen(checker_message(c))) ++ if (daemon) { ++ if (path_blocked(pp)) ++ return PATH_PENDING; ++ checker_set_async(c); ++ } ++ state = checker_check(c); ++ condlog(3, "%s: state = %i", pp->dev, state); ++ if (state == PATH_DOWN && strlen(checker_message(c))) + condlog(3, "%s: checker msg is \"%s\"", + pp->dev, checker_message(c)); +- return 0; ++ return state; + } + + static int +@@ -813,8 +844,11 @@ pathinfo (struct path *pp, vector hwtabl + cciss_ioctl_pathinfo(pp, mask)) + goto blank; + +- if (mask & DI_CHECKER && get_state(pp)) +- goto blank; ++ if (mask & DI_CHECKER) { ++ pp->state = get_state(pp, 0); ++ if (pp->state == PATH_UNCHECKED || pp->state == PATH_WILD) ++ goto blank; ++ } + + /* + * Retrieve path priority, even for PATH_DOWN paths if it has never +Index: multipath-tools-090724/libmultipath/discovery.h +=================================================================== +--- multipath-tools-090724.orig/libmultipath/discovery.h ++++ multipath-tools-090724/libmultipath/discovery.h +@@ -30,6 +30,8 @@ int path_discovery (vector pathvec, stru + int do_tur (char *); + int devt2devname (char *, char *); + int path_offline (struct path *); ++int get_state (struct path * pp, int daemon); ++int path_blocked (struct path *); + int pathinfo (struct path *, vector hwtable, int mask); + struct path * store_pathinfo (vector pathvec, vector hwtable, + char * devname, int flag); +Index: multipath-tools-090724/multipathd/main.c +=================================================================== +--- multipath-tools-090724.orig/multipathd/main.c ++++ multipath-tools-090724/multipathd/main.c +@@ -908,26 +908,9 @@ check_path (struct vectors * vecs, struc + */ + pp->tick = conf->checkint; + +- if (!checker_selected(&pp->checker)) { +- pathinfo(pp, conf->hwtable, DI_SYSFS); +- select_checker(pp); +- } +- if (!checker_selected(&pp->checker)) { +- condlog(0, "%s: checker is not set", pp->dev); +- return; +- } +- /* +- * Set checker in async mode. +- * Honored only by checker implementing the said mode. +- */ +- checker_set_async(&pp->checker); +- +- if (path_offline(pp)) +- newstate = PATH_DOWN; +- else +- newstate = checker_check(&pp->checker); ++ newstate = get_state(pp, 1); + +- if (newstate < 0) { ++ if (newstate == PATH_WILD || newstate == PATH_UNCHECKED) { + condlog(2, "%s: unusable path", pp->dev); + pathinfo(pp, conf->hwtable, 0); + return; diff --git a/queue_without_daemon.patch b/queue_without_daemon.patch new file mode 100644 index 0000000..209f37b --- /dev/null +++ b/queue_without_daemon.patch @@ -0,0 +1,153 @@ +--- + libmultipath/config.h | 1 + + libmultipath/dict.c | 35 +++++++++++++++++++++++++++++++++++ + libmultipath/structs.h | 6 ++++++ + multipath.conf.annotated | 9 +++++++++ + multipath.conf.synthetic | 1 + + multipathd/main.c | 5 +++++ + 6 files changed, 57 insertions(+) + +Index: multipath-tools-090724/libmultipath/config.h +=================================================================== +--- multipath-tools-090724.orig/libmultipath/config.h ++++ multipath-tools-090724/libmultipath/config.h +@@ -72,6 +72,7 @@ struct config { + int pg_timeout; + int max_fds; + int force_reload; ++ int queue_without_daemon; + int daemon; + int flush_on_last_del; + int attribute_flags; +Index: multipath-tools-090724/libmultipath/dict.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/dict.c ++++ multipath-tools-090724/libmultipath/dict.c +@@ -333,6 +333,28 @@ def_no_path_retry_handler(vector strvec) + } + + static int ++def_queue_without_daemon(vector strvec) ++{ ++ char * buff; ++ ++ buff = set_value(strvec); ++ if (!buff) ++ return 1; ++ ++ if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) || ++ !strncmp(buff, "0", 1)) ++ conf->queue_without_daemon = QUE_NO_DAEMON_OFF; ++ else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) || ++ !strncmp(buff, "1", 1)) ++ conf->queue_without_daemon = QUE_NO_DAEMON_ON; ++ else ++ conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF; ++ ++ free(buff); ++ return 0; ++} ++ ++static int + def_pg_timeout_handler(vector strvec) + { + int pg_timeout; +@@ -1846,6 +1868,18 @@ snprint_def_no_path_retry (char * buff, + } + + static int ++snprint_def_queue_without_daemon (char * buff, int len, void * data) ++{ ++ switch (conf->queue_without_daemon) { ++ case QUE_NO_DAEMON_OFF: ++ return snprintf(buff, len, "no"); ++ case QUE_NO_DAEMON_ON: ++ return snprintf(buff, len, "yes"); ++ } ++ return 0; ++} ++ ++static int + snprint_def_pg_timeout (char * buff, int len, void * data) + { + if (conf->pg_timeout == DEFAULT_PGTIMEOUT) +@@ -1931,6 +1965,7 @@ init_keywords(void) + install_keyword("max_fds", &max_fds_handler, &snprint_max_fds); + install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight); + install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry); ++ install_keyword("queue_without_daemon", &def_queue_without_daemon, &snprint_def_queue_without_daemon); + install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout); + install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del); + install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names); +Index: multipath-tools-090724/libmultipath/structs.h +=================================================================== +--- multipath-tools-090724.orig/libmultipath/structs.h ++++ multipath-tools-090724/libmultipath/structs.h +@@ -63,6 +63,12 @@ enum pgstates { + PGSTATE_ACTIVE + }; + ++enum queue_without_daemon_states { ++ QUE_NO_DAEMON_UNDEF, ++ QUE_NO_DAEMON_OFF, ++ QUE_NO_DAEMON_ON, ++}; ++ + enum pgtimeouts { + PGTIMEOUT_UNDEF, + PGTIMEOUT_NONE +Index: multipath-tools-090724/multipath.conf.annotated +=================================================================== +--- multipath-tools-090724.orig/multipath.conf.annotated ++++ multipath-tools-090724/multipath.conf.annotated +@@ -151,6 +151,15 @@ + # no_path_retry queue + # + # # ++# # name : queue_without_daemon ++# # scope : multipathd ++# # desc : If set to "no", multipathd will disable queueing for all ++# # devices when it is shut down. ++# # values : yes|no ++# # default : yes ++# queue_without_daemon no ++# ++# # + # # name : user_friendly_names + # # scope : multipath + # # desc : If set to "yes", using the bindings file +Index: multipath-tools-090724/multipath.conf.synthetic +=================================================================== +--- multipath-tools-090724.orig/multipath.conf.synthetic ++++ multipath-tools-090724/multipath.conf.synthetic +@@ -16,6 +16,7 @@ + # rr_weight priorities + # failback immediate + # no_path_retry fail ++# queue_without_daemon no + # user_friendly_names no + # mode 644 + # uid 0 +Index: multipath-tools-090724/multipathd/main.c +=================================================================== +--- multipath-tools-090724.orig/multipathd/main.c ++++ multipath-tools-090724/multipathd/main.c +@@ -1334,6 +1334,8 @@ child (void * param) + pthread_t check_thr, uevent_thr, uxlsnr_thr; + pthread_attr_t log_attr, misc_attr; + struct vectors * vecs; ++ struct multipath * mpp; ++ int i; + + mlockall(MCL_CURRENT | MCL_FUTURE); + +@@ -1422,6 +1424,9 @@ child (void * param) + */ + block_signal(SIGHUP, NULL); + lock(vecs->lock); ++ if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF) ++ vector_foreach_slot(vecs->mpvec, mpp, i) ++ dm_queue_if_no_path(mpp->alias, 0); + remove_maps_and_stop_waiters(vecs); + free_pathvec(vecs->pathvec, FREE_PATHS); + diff --git a/redhatification.patch b/redhatification.patch index 79e73da..489af84 100644 --- a/redhatification.patch +++ b/redhatification.patch @@ -1,8 +1,8 @@ -Index: multipath-tools-090407/libmultipath/hwtable.c +Index: multipath-tools-090724/libmultipath/hwtable.c =================================================================== ---- multipath-tools-090407.orig/libmultipath/hwtable.c 2009-04-07 15:21:33.000000000 -0500 -+++ multipath-tools-090407/libmultipath/hwtable.c 2009-04-07 09:16:31.000000000 -0500 -@@ -554,7 +554,7 @@ static struct hwentry default_hw[] = { +--- multipath-tools-090724.orig/libmultipath/hwtable.c ++++ multipath-tools-090724/libmultipath/hwtable.c +@@ -589,7 +589,7 @@ static struct hwentry default_hw[] = { .vendor = "IBM", .product = "S/390 DASD ECKD", .bl_product = "S/390.*", @@ -11,10 +11,49 @@ Index: multipath-tools-090407/libmultipath/hwtable.c .features = "1 queue_if_no_path", .hwhandler = DEFAULT_HWHANDLER, .selector = DEFAULT_SELECTOR, -Index: multipath-tools-090407/multipath/multipath.conf.redhat +Index: multipath-tools-090724/Makefile.inc =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ multipath-tools-090407/multipath/multipath.conf.redhat 2009-04-07 09:16:31.000000000 -0500 +--- multipath-tools-090724.orig/Makefile.inc ++++ multipath-tools-090724/Makefile.inc +@@ -26,7 +26,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 + syslibdir = $(prefix)/$(LIB) + libdir = $(prefix)/$(LIB)/multipath + +Index: multipath-tools-090724/multipathd/Makefile +=================================================================== +--- multipath-tools-090724.orig/multipathd/Makefile ++++ multipath-tools-090724/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-090724/multipath/Makefile +=================================================================== +--- multipath-tools-090724.orig/multipath/Makefile ++++ multipath-tools-090724/multipath/Makefile +@@ -27,6 +27,9 @@ 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 + + uninstall: + rm $(DESTDIR)/etc/udev/rules.d/multipath.rules +Index: multipath-tools-090724/multipath/multipath.conf.redhat +=================================================================== +--- /dev/null ++++ multipath-tools-090724/multipath/multipath.conf.redhat @@ -0,0 +1,97 @@ +# This is a basic configuration file with some examples, for device mapper +# multipath. @@ -113,10 +152,10 @@ Index: multipath-tools-090407/multipath/multipath.conf.redhat +# path_grouping_policy multibus +# } +#} -Index: multipath-tools-090407/kpartx/Makefile +Index: multipath-tools-090724/kpartx/Makefile =================================================================== ---- multipath-tools-090407.orig/kpartx/Makefile 2009-04-07 15:21:33.000000000 -0500 -+++ multipath-tools-090407/kpartx/Makefile 2009-04-07 09:16:31.000000000 -0500 +--- multipath-tools-090724.orig/kpartx/Makefile ++++ multipath-tools-090724/kpartx/Makefile @@ -20,10 +20,10 @@ $(EXEC): $(OBJS) install: $(EXEC) $(EXEC).8 $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) diff --git a/root_init_script.patch b/root_init_script.patch new file mode 100644 index 0000000..1376b57 --- /dev/null +++ b/root_init_script.patch @@ -0,0 +1,70 @@ +Index: multipath-tools-090724/multipathd/multipathd.init.redhat +=================================================================== +--- multipath-tools-090724.orig/multipathd/multipathd.init.redhat ++++ multipath-tools-090724/multipathd/multipathd.init.redhat +@@ -2,7 +2,7 @@ + # + # multipathd Starts the multipath daemon + # +-# chkconfig: - 13 87 ++# chkconfig: - 06 87 + # description: Manages device-mapper multipath devices + + ### BEGIN INIT INFO +@@ -17,6 +17,7 @@ prog=`basename $DAEMON` + initdir=/etc/rc.d/init.d + lockdir=/var/lock/subsys + sysconfig=/etc/sysconfig ++syspath=/sys/block + + + . $initdir/functions +@@ -25,6 +26,36 @@ test -r $sysconfig/$prog && . $sysconfig + + RETVAL=0 + ++teardown_slaves() ++{ ++pushd $1 > /dev/null ++if [ -d "slaves" ]; then ++for slave in slaves/*; ++do ++ if [ "$slave" = "slaves/*" ]; then ++ read dev < $1/dev ++ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"` ++ if ! [ -z $tablename ]; then ++ echo "Root is on a multipathed device, multipathd can not be stopped" ++ exit 1 ++ fi ++ else ++ local_slave=`readlink -f $slave`; ++ teardown_slaves $local_slave; ++ fi ++ done ++ ++else ++ read dev < $1/dev ++ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"` ++ if ! [ -z $tablename ]; then ++ echo "Root is on a multipathed device, multipathd can not be stopped" ++ exit 1 ++ fi ++fi ++popd > /dev/null ++} ++ + # + # See how we were called. + # +@@ -39,6 +70,11 @@ start() { + } + + stop() { ++ root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab) ++ dm_num=`dmsetup info -c --noheadings -o minor $root_dev` ++ root_dm_device="dm-$dm_num" ++ [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device ++ + echo -n $"Stopping $prog daemon: " + killproc $DAEMON + RETVAL=$? diff --git a/sources b/sources index 6db3245..405684e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -450d0715048f3a8c82082ad2b9e5a2b3 multipath-tools-090429.tgz +89a2e3d5ee8e78c7fb487cae00345815 multipath-tools-090729.tgz diff --git a/stop_warnings.patch b/stop_warnings.patch new file mode 100644 index 0000000..534970b --- /dev/null +++ b/stop_warnings.patch @@ -0,0 +1,24 @@ +Index: multipath-tools-090724/libmultipath/log_pthread.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/log_pthread.c ++++ multipath-tools-090724/libmultipath/log_pthread.c +@@ -56,6 +56,7 @@ static void * log_thread (void * et) + + flush_logqueue(); + } ++ return NULL; + } + + void log_thread_start (pthread_attr_t *attr) +Index: multipath-tools-090724/libmultipath/uevent.c +=================================================================== +--- multipath-tools-090724.orig/libmultipath/uevent.c ++++ multipath-tools-090724/libmultipath/uevent.c +@@ -101,6 +101,7 @@ uevq_thread(void * et) + + service_uevq(); + } ++ return NULL; + } + + int uevent_listen(int (*uev_trigger)(struct uevent *, void * trigger_data), diff --git a/uninstall.patch b/uninstall.patch new file mode 100644 index 0000000..8281cc3 --- /dev/null +++ b/uninstall.patch @@ -0,0 +1,26 @@ +Index: multipath-tools-090724/libmultipath/checkers/Makefile +=================================================================== +--- multipath-tools-090724.orig/libmultipath/checkers/Makefile ++++ multipath-tools-090724/libmultipath/checkers/Makefile +@@ -27,7 +27,7 @@ install: + $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(libdir) + + uninstall: +- rm -f $(DESTDIR)$(libdir)/$(LIBS) ++ for file in $(LIBS); do rm -f $(DESTDIR)$(libdir)/$$file; done + + clean: + rm -f core *.a *.o *.gz *.so +Index: multipath-tools-090724/libmultipath/prioritizers/Makefile +=================================================================== +--- multipath-tools-090724.orig/libmultipath/prioritizers/Makefile ++++ multipath-tools-090724/libmultipath/prioritizers/Makefile +@@ -28,7 +28,7 @@ install: $(LIBS) + $(INSTALL_PROGRAM) -m 755 libprio*.so $(DESTDIR)$(libdir) + + uninstall: +- rm -f $(DESTDIR)$(libdir)/libprio*.so ++ for file in $(LIBS); do rm -f $(DESTDIR)$(libdir)/$$file; done + + clean: + rm -f core *.a *.o *.gz *.so