From 91d375be4a9702d236bb378b51ebe09948b12c32 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 21 Aug 2012 12:55:08 -0400 Subject: [PATCH] device-mapper-multipath-0.4.9-29 - Updated to latest upstrem 0.4.9 code: multipath-tools-120821.tgz (git commit id: 050b24b33d3c60e29f7820d2fb75e84a9edde528) * includes 0001-RH-remove_callout.patch, 0002-RH-add-wwids-file.patch, 0003-RH-add-followover.patch, 0004-RH-fix-cciss-names.patch - Add 0013-RH-kpartx-msg.patch - Modify 0002-RH-multipath.rules.patch * removed socket call from rules file --- .gitignore | 1 + ...=> 0001-RH-dont_start_with_no_config.patch | 0 0001-RH-remove_callout.patch | 279 ------- 0002-RH-add-wwids-file.patch | 748 ------------------ ...les.patch => 0002-RH-multipath.rules.patch | 19 +- ...Make-build-system-RH-Fedora-friendly.patch | 0 0003-RH-add-followover.patch | 235 ------ 0004-RH-fix-cciss-names.patch | 34 - ...-multipathd-blacklist-all-by-default.patch | 14 +- ...hconf.patch => 0005-RH-add-mpathconf.patch | 28 +- ...patch => 0006-RH-add-find-multipaths.patch | 68 +- ....patch => 0007-RH-add-hp_tur-checker.patch | 0 ...ch => 0008-RH-RHEL5-style-partitions.patch | 0 ...=> 0009-RH-dont-remove-map-on-enomem.patch | 0 ...ch => 0010-RH-deprecate-uid-gid-mode.patch | 0 ...rt.patch => 0011-RH-use-sync-support.patch | 0 ...figs.patch => 0012-RH-change-configs.patch | 14 +- 0013-RH-kpartx-msg.patch | 24 + device-mapper-multipath.spec | 47 +- sources | 2 +- 20 files changed, 122 insertions(+), 1391 deletions(-) rename 0005-RH-dont_start_with_no_config.patch => 0001-RH-dont_start_with_no_config.patch (100%) delete mode 100644 0001-RH-remove_callout.patch delete mode 100644 0002-RH-add-wwids-file.patch rename 0006-RH-multipath.rules.patch => 0002-RH-multipath.rules.patch (81%) rename 0007-RH-Make-build-system-RH-Fedora-friendly.patch => 0003-RH-Make-build-system-RH-Fedora-friendly.patch (100%) delete mode 100644 0003-RH-add-followover.patch delete mode 100644 0004-RH-fix-cciss-names.patch rename 0008-RH-multipathd-blacklist-all-by-default.patch => 0004-RH-multipathd-blacklist-all-by-default.patch (83%) rename 0009-RH-add-mpathconf.patch => 0005-RH-add-mpathconf.patch (95%) rename 0010-RH-add-find-multipaths.patch => 0006-RH-add-find-multipaths.patch (75%) rename 0011-RH-add-hp_tur-checker.patch => 0007-RH-add-hp_tur-checker.patch (100%) rename 0012-RH-RHEL5-style-partitions.patch => 0008-RH-RHEL5-style-partitions.patch (100%) rename 0013-RH-dont-remove-map-on-enomem.patch => 0009-RH-dont-remove-map-on-enomem.patch (100%) rename 0014-RH-deprecate-uid-gid-mode.patch => 0010-RH-deprecate-uid-gid-mode.patch (100%) rename 0015-RH-use-sync-support.patch => 0011-RH-use-sync-support.patch (100%) rename 0016-RH-change-configs.patch => 0012-RH-change-configs.patch (98%) create mode 100644 0013-RH-kpartx-msg.patch diff --git a/.gitignore b/.gitignore index dbde256..8c66e89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ multipath-tools-091027.tar.gz /multipath-tools-120123.tgz /multipath-tools-120613.tgz +/multipath-tools-120821.tgz diff --git a/0005-RH-dont_start_with_no_config.patch b/0001-RH-dont_start_with_no_config.patch similarity index 100% rename from 0005-RH-dont_start_with_no_config.patch rename to 0001-RH-dont_start_with_no_config.patch diff --git a/0001-RH-remove_callout.patch b/0001-RH-remove_callout.patch deleted file mode 100644 index 0c03cc4..0000000 --- a/0001-RH-remove_callout.patch +++ /dev/null @@ -1,279 +0,0 @@ ---- - libmultipath/Makefile | 2 - libmultipath/callout.c | 217 ----------------------------------------------- - libmultipath/callout.h | 7 - - libmultipath/discovery.c | 1 - multipathd/main.c | 1 - 5 files changed, 1 insertion(+), 227 deletions(-) - -Index: multipath-tools-120518/libmultipath/Makefile -=================================================================== ---- multipath-tools-120518.orig/libmultipath/Makefile -+++ multipath-tools-120518/libmultipath/Makefile -@@ -9,7 +9,7 @@ DEVLIB = libmultipath.so - LIBS = $(DEVLIB).$(SONAME) - LIBDEPS = -lpthread -ldl -ldevmapper -ludev - --OBJS = memory.o parser.o vector.o devmapper.o callout.o \ -+OBJS = memory.o parser.o vector.o devmapper.o \ - hwtable.o blacklist.o util.o dmparser.o config.o \ - structs.o discovery.o propsel.o dict.o \ - pgpolicies.o debug.o regex.o defaults.o uevent.o \ -Index: multipath-tools-120518/libmultipath/callout.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/callout.c -+++ /dev/null -@@ -1,217 +0,0 @@ --/* -- * Source: copy of the udev package source file -- * -- * Copyrights of the source file apply -- * Copyright (c) 2004 Christophe Varoqui -- */ --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "checkers.h" --#include "vector.h" --#include "structs.h" --#include "util.h" --#include "debug.h" -- --int execute_program(char *path, char *value, int len) --{ -- int retval; -- int count; -- int status; -- int fds[2], null_fd; -- pid_t pid; -- char *pos; -- char arg[CALLOUT_MAX_SIZE]; -- int argc = sizeof(arg) / 2; -- char *argv[argc + 1]; -- int i; -- -- i = 0; -- -- if (strchr(path, ' ')) { -- strlcpy(arg, path, sizeof(arg)); -- pos = arg; -- while (pos != NULL && i < argc) { -- if (pos[0] == '\'') { -- /* don't separate if in apostrophes */ -- pos++; -- argv[i] = strsep(&pos, "\'"); -- while (pos[0] == ' ') -- pos++; -- } else { -- argv[i] = strsep(&pos, " "); -- } -- i++; -- } -- } else { -- argv[i++] = path; -- } -- argv[i] = NULL; -- -- retval = pipe(fds); -- -- if (retval != 0) { -- condlog(0, "error creating pipe for callout: %s", strerror(errno)); -- return -1; -- } -- -- pid = fork(); -- -- switch(pid) { -- case 0: -- /* child */ -- close(STDOUT_FILENO); -- -- /* dup write side of pipe to STDOUT */ -- if (dup(fds[1]) < 0) -- return -1; -- -- /* Ignore writes to stderr */ -- null_fd = open("/dev/null", O_WRONLY); -- if (null_fd > 0) { -- close(STDERR_FILENO); -- dup(null_fd); -- close(null_fd); -- } -- -- retval = execv(argv[0], argv); -- condlog(0, "error execing %s : %s", argv[0], strerror(errno)); -- exit(-1); -- case -1: -- condlog(0, "fork failed: %s", strerror(errno)); -- close(fds[0]); -- close(fds[1]); -- return -1; -- default: -- /* parent reads from fds[0] */ -- close(fds[1]); -- retval = 0; -- i = 0; -- while (1) { -- count = read(fds[0], value + i, len - i-1); -- if (count <= 0) -- break; -- -- i += count; -- if (i >= len-1) { -- condlog(0, "not enough space for response from %s", argv[0]); -- retval = -1; -- break; -- } -- } -- -- if (count < 0) { -- condlog(0, "no response from %s", argv[0]); -- retval = -1; -- } -- -- if (i > 0 && value[i-1] == '\n') -- i--; -- value[i] = '\0'; -- -- wait(&status); -- close(fds[0]); -- -- retval = -1; -- if (WIFEXITED(status)) { -- status = WEXITSTATUS(status); -- if (status == 0) -- retval = 0; -- else -- condlog(0, "%s exitted with %d", argv[0], status); -- } -- else if (WIFSIGNALED(status)) -- condlog(0, "%s was terminated by signal %d", argv[0], WTERMSIG(status)); -- else -- condlog(0, "%s terminated abnormally", argv[0]); -- } -- return retval; --} -- --extern int --apply_format (char * string, char * cmd, struct path * pp) --{ -- char * pos; -- char * dst; -- char * p; -- char * q; -- int len; -- int myfree; -- -- if (!string) -- return 1; -- -- if (!cmd) -- return 1; -- -- dst = cmd; -- p = dst; -- pos = strchr(string, '%'); -- myfree = CALLOUT_MAX_SIZE; -- -- if (!pos) { -- strcpy(dst, string); -- return 0; -- } -- -- len = (int) (pos - string) + 1; -- myfree -= len; -- -- if (myfree < 2) -- return 1; -- -- snprintf(p, len, "%s", string); -- p += len - 1; -- pos++; -- -- switch (*pos) { -- case 'n': -- len = strlen(pp->dev) + 1; -- myfree -= len; -- -- if (myfree < 2) -- return 1; -- -- snprintf(p, len, "%s", pp->dev); -- for (q = p; q < p + len; q++) { -- if (q && *q == '!') -- *q = '/'; -- } -- p += len - 1; -- break; -- case 'd': -- len = strlen(pp->dev_t) + 1; -- myfree -= len; -- -- if (myfree < 2) -- return 1; -- -- snprintf(p, len, "%s", pp->dev_t); -- p += len - 1; -- break; -- default: -- break; -- } -- pos++; -- -- if (!*pos) -- return 0; -- -- len = strlen(pos) + 1; -- myfree -= len; -- -- if (myfree < 2) -- return 1; -- -- snprintf(p, len, "%s", pos); -- condlog(3, "reformated callout = %s", dst); -- return 0; --} -- -Index: multipath-tools-120518/libmultipath/callout.h -=================================================================== ---- multipath-tools-120518.orig/libmultipath/callout.h -+++ /dev/null -@@ -1,7 +0,0 @@ --#ifndef _CALLOUT_H --#define _CALLOUT_H -- --int execute_program(char *, char *, int); --int apply_format (char *, char *, struct path *); -- --#endif /* _CALLOUT_H */ -Index: multipath-tools-120518/libmultipath/discovery.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/discovery.c -+++ multipath-tools-120518/libmultipath/discovery.c -@@ -20,7 +20,6 @@ - #include "structs.h" - #include "config.h" - #include "blacklist.h" --#include "callout.h" - #include "debug.h" - #include "propsel.h" - #include "sg_include.h" -Index: multipath-tools-120518/multipathd/main.c -=================================================================== ---- multipath-tools-120518.orig/multipathd/main.c -+++ multipath-tools-120518/multipathd/main.c -@@ -35,7 +35,6 @@ - #include - #include - #include --#include - #include - #include - #include diff --git a/0002-RH-add-wwids-file.patch b/0002-RH-add-wwids-file.patch deleted file mode 100644 index f3014ba..0000000 --- a/0002-RH-add-wwids-file.patch +++ /dev/null @@ -1,748 +0,0 @@ ---- - libmultipath/Makefile | 2 - libmultipath/alias.c | 153 --------------------------------------- - libmultipath/alias.h | 1 - libmultipath/configure.c | 3 - libmultipath/defaults.h | 1 - libmultipath/discovery.c | 2 - libmultipath/file.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++ - libmultipath/file.h | 11 ++ - libmultipath/wwids.c | 139 ++++++++++++++++++++++++++++++++++++ - libmultipath/wwids.h | 18 ++++ - multipath/main.c | 37 ++++++++- - 11 files changed, 389 insertions(+), 158 deletions(-) - -Index: multipath-tools-120518/libmultipath/alias.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/alias.c -+++ multipath-tools-120518/libmultipath/alias.c -@@ -3,19 +3,16 @@ - * Copyright (c) 2005 Benjamin Marzinski, Redhat - */ - #include --#include --#include --#include - #include - #include - #include - #include - #include --#include - - #include "debug.h" - #include "uxsock.h" - #include "alias.h" -+#include "file.h" - - - /* -@@ -36,150 +33,6 @@ - * See the file COPYING included with this distribution for more details. - */ - --static int --ensure_directories_exist(char *str, mode_t dir_mode) --{ -- char *pathname; -- char *end; -- int err; -- -- pathname = strdup(str); -- if (!pathname){ -- condlog(0, "Cannot copy bindings file pathname : %s", -- strerror(errno)); -- return -1; -- } -- end = pathname; -- /* skip leading slashes */ -- while (end && *end && (*end == '/')) -- end++; -- -- while ((end = strchr(end, '/'))) { -- /* if there is another slash, make the dir. */ -- *end = '\0'; -- err = mkdir(pathname, dir_mode); -- if (err && errno != EEXIST) { -- condlog(0, "Cannot make directory [%s] : %s", -- pathname, strerror(errno)); -- free(pathname); -- return -1; -- } -- if (!err) -- condlog(3, "Created dir [%s]", pathname); -- *end = '/'; -- end++; -- } -- free(pathname); -- return 0; --} -- --static void --sigalrm(int sig) --{ -- /* do nothing */ --} -- --static int --lock_bindings_file(int fd) --{ -- struct sigaction act, oldact; -- sigset_t set, oldset; -- struct flock lock; -- int err; -- -- memset(&lock, 0, sizeof(lock)); -- lock.l_type = F_WRLCK; -- lock.l_whence = SEEK_SET; -- -- act.sa_handler = sigalrm; -- sigemptyset(&act.sa_mask); -- act.sa_flags = 0; -- sigemptyset(&set); -- sigaddset(&set, SIGALRM); -- -- sigaction(SIGALRM, &act, &oldact); -- sigprocmask(SIG_UNBLOCK, &set, &oldset); -- -- alarm(BINDINGS_FILE_TIMEOUT); -- err = fcntl(fd, F_SETLKW, &lock); -- alarm(0); -- -- if (err) { -- if (errno != EINTR) -- condlog(0, "Cannot lock bindings file : %s", -- strerror(errno)); -- else -- condlog(0, "Bindings file is locked. Giving up."); -- } -- -- sigprocmask(SIG_SETMASK, &oldset, NULL); -- sigaction(SIGALRM, &oldact, NULL); -- return err; -- --} -- -- --static int --open_bindings_file(char *file, int *can_write) --{ -- int fd; -- struct stat s; -- -- if (ensure_directories_exist(file, 0700)) -- return -1; -- *can_write = 1; -- fd = open(file, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); -- if (fd < 0) { -- if (errno == EROFS) { -- *can_write = 0; -- condlog(3, "Cannot open bindings file [%s] read/write. " -- " trying readonly", file); -- fd = open(file, O_RDONLY); -- if (fd < 0) { -- condlog(0, "Cannot open bindings file [%s] " -- "readonly : %s", file, strerror(errno)); -- return -1; -- } -- } -- else { -- condlog(0, "Cannot open bindings file [%s] : %s", file, -- strerror(errno)); -- return -1; -- } -- } -- if (*can_write && lock_bindings_file(fd) < 0) -- goto fail; -- -- memset(&s, 0, sizeof(s)); -- if (fstat(fd, &s) < 0){ -- condlog(0, "Cannot stat bindings file : %s", strerror(errno)); -- goto fail; -- } -- if (s.st_size == 0) { -- if (*can_write == 0) -- goto fail; -- /* If bindings file is empty, write the header */ -- size_t len = strlen(BINDINGS_FILE_HEADER); -- if (write_all(fd, BINDINGS_FILE_HEADER, len) != len) { -- condlog(0, -- "Cannot write header to bindings file : %s", -- strerror(errno)); -- /* cleanup partially written header */ -- if (ftruncate(fd, 0)) -- condlog(0, "Cannot truncate the header : %s", -- strerror(errno)); -- goto fail; -- } -- fsync(fd); -- condlog(3, "Initialized new bindings file [%s]", file); -- } -- -- return fd; -- --fail: -- close(fd); -- return -1; --} - - static int - format_devname(char *name, int id, int len, char *prefix) -@@ -370,7 +223,7 @@ get_user_friendly_alias(char *wwid, char - return NULL; - } - -- fd = open_bindings_file(file, &can_write); -+ fd = open_file(file, &can_write, BINDINGS_FILE_HEADER); - if (fd < 0) - return NULL; - -@@ -414,7 +267,7 @@ get_user_friendly_wwid(char *alias, char - return NULL; - } - -- fd = open_bindings_file(file, &unused); -+ fd = open_file(file, &unused, BINDINGS_FILE_HEADER); - if (fd < 0) - return NULL; - -Index: multipath-tools-120518/libmultipath/alias.h -=================================================================== ---- multipath-tools-120518.orig/libmultipath/alias.h -+++ multipath-tools-120518/libmultipath/alias.h -@@ -1,4 +1,3 @@ --#define BINDINGS_FILE_TIMEOUT 30 - #define BINDINGS_FILE_HEADER \ - "# Multipath bindings, Version : 1.0\n" \ - "# NOTE: this file is automatically maintained by the multipath program.\n" \ -Index: multipath-tools-120518/libmultipath/configure.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/configure.c -+++ multipath-tools-120518/libmultipath/configure.c -@@ -37,6 +37,7 @@ - #include "prio.h" - #include "util.h" - #include "uxsock.h" -+#include "wwids.h" - - extern int - setup_map (struct multipath * mpp, char * params, int params_size) -@@ -407,6 +408,8 @@ domap (struct multipath * mpp, char * pa - * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD - * succeeded - */ -+ if (mpp->action == ACT_CREATE) -+ remember_wwid(mpp->wwid); - if (!conf->daemon) { - /* multipath client mode */ - dm_switchgroup(mpp->alias, mpp->bestpg); -Index: multipath-tools-120518/libmultipath/defaults.h -=================================================================== ---- multipath-tools-120518.orig/libmultipath/defaults.h -+++ multipath-tools-120518/libmultipath/defaults.h -@@ -24,5 +24,6 @@ - #define DEFAULT_SOCKET "/var/run/multipathd.sock" - #define DEFAULT_CONFIGFILE "/etc/multipath.conf" - #define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" -+#define DEFAULT_WWIDS_FILE "/etc/multipath/wwids" - - char * set_default (char * str); -Index: multipath-tools-120518/libmultipath/file.c -=================================================================== ---- /dev/null -+++ multipath-tools-120518/libmultipath/file.c -@@ -0,0 +1,180 @@ -+/* -+ * Copyright (c) 2005 Christophe Varoqui -+ * Copyright (c) 2005 Benjamin Marzinski, Redhat -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "file.h" -+#include "debug.h" -+#include "uxsock.h" -+ -+ -+/* -+ * significant parts of this file were taken from iscsi-bindings.c of the -+ * linux-iscsi project. -+ * Copyright (C) 2002 Cisco Systems, Inc. -+ * -+ * 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. -+ * -+ * See the file COPYING included with this distribution for more details. -+ */ -+ -+static int -+ensure_directories_exist(char *str, mode_t dir_mode) -+{ -+ char *pathname; -+ char *end; -+ int err; -+ -+ pathname = strdup(str); -+ if (!pathname){ -+ condlog(0, "Cannot copy file pathname %s : %s", -+ str, strerror(errno)); -+ return -1; -+ } -+ end = pathname; -+ /* skip leading slashes */ -+ while (end && *end && (*end == '/')) -+ end++; -+ -+ while ((end = strchr(end, '/'))) { -+ /* if there is another slash, make the dir. */ -+ *end = '\0'; -+ err = mkdir(pathname, dir_mode); -+ if (err && errno != EEXIST) { -+ condlog(0, "Cannot make directory [%s] : %s", -+ pathname, strerror(errno)); -+ free(pathname); -+ return -1; -+ } -+ if (!err) -+ condlog(3, "Created dir [%s]", pathname); -+ *end = '/'; -+ end++; -+ } -+ free(pathname); -+ return 0; -+} -+ -+static void -+sigalrm(int sig) -+{ -+ /* do nothing */ -+} -+ -+static int -+lock_file(int fd, char *file_name) -+{ -+ struct sigaction act, oldact; -+ sigset_t set, oldset; -+ struct flock lock; -+ int err; -+ -+ memset(&lock, 0, sizeof(lock)); -+ lock.l_type = F_WRLCK; -+ lock.l_whence = SEEK_SET; -+ -+ act.sa_handler = sigalrm; -+ sigemptyset(&act.sa_mask); -+ act.sa_flags = 0; -+ sigemptyset(&set); -+ sigaddset(&set, SIGALRM); -+ -+ sigaction(SIGALRM, &act, &oldact); -+ sigprocmask(SIG_UNBLOCK, &set, &oldset); -+ -+ alarm(FILE_TIMEOUT); -+ err = fcntl(fd, F_SETLKW, &lock); -+ alarm(0); -+ -+ if (err) { -+ if (errno != EINTR) -+ condlog(0, "Cannot lock %s : %s", file_name, -+ strerror(errno)); -+ else -+ condlog(0, "%s is locked. Giving up.", file_name); -+ } -+ -+ sigprocmask(SIG_SETMASK, &oldset, NULL); -+ sigaction(SIGALRM, &oldact, NULL); -+ return err; -+} -+ -+int -+open_file(char *file, int *can_write, char *header) -+{ -+ int fd; -+ struct stat s; -+ -+ if (ensure_directories_exist(file, 0700)) -+ return -1; -+ *can_write = 1; -+ fd = open(file, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); -+ if (fd < 0) { -+ if (errno == EROFS) { -+ *can_write = 0; -+ condlog(3, "Cannot open file [%s] read/write. " -+ " trying readonly", file); -+ fd = open(file, O_RDONLY); -+ if (fd < 0) { -+ condlog(0, "Cannot open file [%s] " -+ "readonly : %s", file, strerror(errno)); -+ return -1; -+ } -+ } -+ else { -+ condlog(0, "Cannot open file [%s] : %s", file, -+ strerror(errno)); -+ return -1; -+ } -+ } -+ if (*can_write && lock_file(fd, file) < 0) -+ goto fail; -+ -+ memset(&s, 0, sizeof(s)); -+ if (fstat(fd, &s) < 0){ -+ condlog(0, "Cannot stat file %s : %s", file, strerror(errno)); -+ goto fail; -+ } -+ if (s.st_size == 0) { -+ if (*can_write == 0) -+ goto fail; -+ /* If file is empty, write the header */ -+ size_t len = strlen(header); -+ if (write_all(fd, header, len) != len) { -+ condlog(0, -+ "Cannot write header to file %s : %s", file, -+ strerror(errno)); -+ /* cleanup partially written header */ -+ if (ftruncate(fd, 0)) -+ condlog(0, "Cannot truncate header : %s", -+ strerror(errno)); -+ goto fail; -+ } -+ fsync(fd); -+ condlog(3, "Initialized new file [%s]", file); -+ } -+ -+ return fd; -+ -+fail: -+ close(fd); -+ return -1; -+} -Index: multipath-tools-120518/libmultipath/file.h -=================================================================== ---- /dev/null -+++ multipath-tools-120518/libmultipath/file.h -@@ -0,0 +1,11 @@ -+/* -+ * Copyright (c) 2010 Benjamin Marzinski, Redhat -+ */ -+ -+#ifndef _FILE_H -+#define _FILE_H -+ -+#define FILE_TIMEOUT 30 -+int open_file(char *file, int *can_write, char *header); -+ -+#endif /* _FILE_H */ -Index: multipath-tools-120518/multipath/main.c -=================================================================== ---- multipath-tools-120518.orig/multipath/main.c -+++ multipath-tools-120518/multipath/main.c -@@ -53,6 +53,7 @@ - #include - #include - #include -+#include - #include "dev_t.h" - - int logsink; -@@ -82,7 +83,7 @@ usage (char * progname) - { - fprintf (stderr, VERSION_STRING); - fprintf (stderr, "Usage:\n"); -- fprintf (stderr, " %s [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); -+ fprintf (stderr, " %s [-c] [-d] [-r] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); - fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [dev]\n", progname); - fprintf (stderr, " %s -F [-v lvl]\n", progname); - fprintf (stderr, " %s -t\n", progname); -@@ -95,6 +96,7 @@ usage (char * progname) - " -ll show multipath topology (maximum info)\n" \ - " -f flush a multipath device map\n" \ - " -F flush all multipath device maps\n" \ -+ " -c check if a device should be a path in a multipath device\n" \ - " -q allow queue_if_no_path when multipathd is not running\n"\ - " -d dry run, do not create or update devmaps\n" \ - " -t dump internal hardware table\n" \ -@@ -209,6 +211,7 @@ get_dm_mpvec (vector curmp, vector pathv - - if (!conf->dry_run) - reinstate_paths(mpp); -+ remember_wwid(mpp->wwid); - } - return 0; - } -@@ -259,9 +262,13 @@ configure (void) - * if we have a blacklisted device parameter, exit early - */ - if (dev && -- (filter_devnode(conf->blist_devnode, conf->elist_devnode, dev) > 0)) -- goto out; -- -+ (filter_devnode(conf->blist_devnode, -+ conf->elist_devnode, dev) > 0)) { -+ if (conf->dry_run == 2) -+ printf("%s is not a valid multipath device path\n", -+ conf->dev); -+ goto out; -+ } - /* - * scope limiting must be translated into a wwid - * failing the translation is fatal (by policy) -@@ -277,6 +284,15 @@ configure (void) - if (filter_wwid(conf->blist_wwid, conf->elist_wwid, - refwwid) > 0) - goto out; -+ if (conf->dry_run == 2) { -+ if (check_wwids_file(refwwid, 0) == 0){ -+ printf("%s is a valid multipath device path\n", conf->dev); -+ r = 0; -+ } -+ else -+ printf("%s is not a valid multipath device path\n", conf->dev); -+ goto out; -+ } - } - - /* -@@ -412,7 +428,7 @@ main (int argc, char *argv[]) - if (load_config(DEFAULT_CONFIGFILE)) - exit(1); - -- while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:Brtq")) != EOF ) { -+ while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtq")) != EOF ) { - switch(arg) { - case 1: printf("optarg : %s\n",optarg); - break; -@@ -434,8 +450,12 @@ main (int argc, char *argv[]) - case 'q': - conf->allow_queueing = 1; - break; -+ case 'c': -+ conf->dry_run = 2; -+ break; - case 'd': -- conf->dry_run = 1; -+ if (!conf->dry_run) -+ conf->dry_run = 1; - break; - case 'f': - conf->remove = FLUSH_ONE; -@@ -517,6 +537,11 @@ main (int argc, char *argv[]) - } - dm_init(); - -+ if (conf->dry_run == 2 && -+ (!conf->dev || conf->dev_type == DEV_DEVMAP)) { -+ condlog(0, "the -c option requires a path to check"); -+ goto out; -+ } - if (conf->remove == FLUSH_ONE) { - if (conf->dev_type == DEV_DEVMAP) - r = dm_flush_map(conf->dev); -Index: multipath-tools-120518/libmultipath/Makefile -=================================================================== ---- multipath-tools-120518.orig/libmultipath/Makefile -+++ multipath-tools-120518/libmultipath/Makefile -@@ -15,7 +15,7 @@ OBJS = memory.o parser.o vector.o devmap - pgpolicies.o debug.o regex.o defaults.o uevent.o \ - switchgroup.o uxsock.o print.o alias.o log_pthread.o \ - log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \ -- lock.o waiter.o -+ lock.o waiter.o file.o wwids.o - - LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h) - -Index: multipath-tools-120518/libmultipath/wwids.c -=================================================================== ---- /dev/null -+++ multipath-tools-120518/libmultipath/wwids.c -@@ -0,0 +1,139 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "checkers.h" -+#include "vector.h" -+#include "structs.h" -+#include "debug.h" -+#include "uxsock.h" -+#include "file.h" -+#include "wwids.h" -+#include "defaults.h" -+ -+/* -+ * Copyright (c) 2010 Benjamin Marzinski, Redhat -+ */ -+ -+static int -+lookup_wwid(FILE *f, char *wwid) { -+ int c; -+ char buf[LINE_MAX]; -+ int count; -+ -+ while ((c = fgetc(f)) != EOF){ -+ if (c != '/') { -+ if (fgets(buf, LINE_MAX, f) == NULL) -+ return 0; -+ else -+ continue; -+ } -+ count = 0; -+ while ((c = fgetc(f)) != '/') { -+ if (c == EOF) -+ return 0; -+ if (count >= WWID_SIZE - 1) -+ goto next; -+ if (wwid[count] == '\0') -+ goto next; -+ if (c != wwid[count++]) -+ goto next; -+ } -+ if (wwid[count] == '\0') -+ return 1; -+next: -+ if (fgets(buf, LINE_MAX, f) == NULL) -+ return 0; -+ } -+ return 0; -+} -+ -+static int -+write_out_wwid(int fd, char *wwid) { -+ int ret; -+ off_t offset; -+ char buf[WWID_SIZE + 3]; -+ -+ ret = snprintf(buf, WWID_SIZE + 3, "/%s/\n", wwid); -+ if (ret >= (WWID_SIZE + 3) || ret < 0){ -+ condlog(0, "can't format wwid for writing (%d) : %s", -+ ret, strerror(errno)); -+ return -1; -+ } -+ offset = lseek(fd, 0, SEEK_END); -+ if (offset < 0) { -+ condlog(0, "can't seek to the end of wwids file : %s", -+ strerror(errno)); -+ return -1; -+ } -+ if (write_all(fd, buf, strlen(buf)) != strlen(buf)) { -+ condlog(0, "cannot write wwid to wwids file : %s", -+ strerror(errno)); -+ if (ftruncate(fd, offset)) -+ condlog(0, "cannot truncate failed wwid write : %s", -+ strerror(errno)); -+ return -1; -+ } -+ return 1; -+} -+ -+int -+check_wwids_file(char *wwid, int write_wwid) -+{ -+ int fd, can_write, found, ret; -+ FILE *f; -+ fd = open_file(DEFAULT_WWIDS_FILE, &can_write, WWIDS_FILE_HEADER); -+ if (fd < 0) -+ return -1; -+ -+ f = fdopen(fd, "r"); -+ if (!f) { -+ condlog(0,"can't fdopen wwids file : %s", strerror(errno)); -+ close(fd); -+ return -1; -+ } -+ found = lookup_wwid(f, wwid); -+ if (found) { -+ ret = 0; -+ goto out; -+ } -+ if (!write_wwid) { -+ ret = -1; -+ goto out; -+ } -+ if (!can_write) { -+ condlog(0, "wwids file is read-only. Can't write wwid"); -+ ret = -1; -+ goto out; -+ } -+ -+ if (fflush(f) != 0) { -+ condlog(0, "cannot fflush wwids file stream : %s", -+ strerror(errno)); -+ ret = -1; -+ goto out; -+ } -+ -+ ret = write_out_wwid(fd, wwid); -+out: -+ fclose(f); -+ return ret; -+} -+ -+int -+remember_wwid(char *wwid) -+{ -+ int ret = check_wwids_file(wwid, 1); -+ if (ret < 0){ -+ condlog(3, "failed writing wwid %s to wwids file", wwid); -+ return -1; -+ } -+ if (ret == 1) -+ condlog(3, "wrote wwid %s to wwids file", wwid); -+ else -+ condlog(4, "wwid %s already in wwids file", wwid); -+ return 0; -+} -Index: multipath-tools-120518/libmultipath/wwids.h -=================================================================== ---- /dev/null -+++ multipath-tools-120518/libmultipath/wwids.h -@@ -0,0 +1,18 @@ -+/* -+ * Copyright (c) 2010 Benjamin Marzinski, Redhat -+ */ -+ -+#ifndef _WWIDS_H -+#define _WWIDS_H -+ -+#define WWIDS_FILE_HEADER \ -+"# Multipath wwids, Version : 1.0\n" \ -+"# NOTE: This file is automatically maintained by multipath and multipathd.\n" \ -+"# You should not need to edit this file in normal circumstances.\n" \ -+"#\n" \ -+"# Valid WWIDs:\n" -+ -+int remember_wwid(char *wwid); -+int check_wwids_file(char *wwid, int write_wwid); -+ -+#endif /* _WWIDS_H */ -Index: multipath-tools-120518/libmultipath/discovery.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/discovery.c -+++ multipath-tools-120518/libmultipath/discovery.c -@@ -810,6 +810,8 @@ get_uid (struct path * pp) - - memset(pp->wwid, 0, WWID_SIZE); - value = udev_device_get_property_value(pp->udev, pp->uid_attribute); -+ if ((!value || strlen(value) == 0) && conf->dry_run == 2) -+ value = getenv(pp->uid_attribute); - if (value && strlen(value)) { - size_t len = WWID_SIZE; - diff --git a/0006-RH-multipath.rules.patch b/0002-RH-multipath.rules.patch similarity index 81% rename from 0006-RH-multipath.rules.patch rename to 0002-RH-multipath.rules.patch index bfcfc98..32eee62 100644 --- a/0006-RH-multipath.rules.patch +++ b/0002-RH-multipath.rules.patch @@ -1,13 +1,13 @@ --- multipath/Makefile | 6 +++--- - multipath/multipath.rules | 30 ++++++++++++++++++++++++------ - 2 files changed, 27 insertions(+), 9 deletions(-) + multipath/multipath.rules | 29 +++++++++++++++++++++++------ + 2 files changed, 26 insertions(+), 9 deletions(-) -Index: multipath-tools-120613/multipath/multipath.rules +Index: multipath-tools-120821/multipath/multipath.rules =================================================================== ---- multipath-tools-120613.orig/multipath/multipath.rules -+++ multipath-tools-120613/multipath/multipath.rules -@@ -1,7 +1,25 @@ +--- multipath-tools-120821.orig/multipath/multipath.rules ++++ multipath-tools-120821/multipath/multipath.rules +@@ -1,7 +1,24 @@ -# -# udev rules for multipathing. -# The persistent symlinks are created with the kpartx rules @@ -30,7 +30,6 @@ Index: multipath-tools-120613/multipath/multipath.rules +ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \ + RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" + -+RUN+="socket:/org/kernel/dm/multipath_event" +KERNEL!="dm-*", GOTO="end_mpath" +ACTION!="change", GOTO="end_mpath" +ENV{DM_UUID}=="mpath-?*|part[0-9]*-mpath-?*", OPTIONS+="link_priority=10" @@ -39,10 +38,10 @@ Index: multipath-tools-120613/multipath/multipath.rules +ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" +RUN+="$env{MPATH_SBIN_PATH}/kpartx -a -p p $tempnode" +LABEL="end_mpath" -Index: multipath-tools-120613/multipath/Makefile +Index: multipath-tools-120821/multipath/Makefile =================================================================== ---- multipath-tools-120613.orig/multipath/Makefile -+++ multipath-tools-120613/multipath/Makefile +--- multipath-tools-120821.orig/multipath/Makefile ++++ multipath-tools-120821/multipath/Makefile @@ -21,15 +21,15 @@ $(EXEC): $(OBJS) install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) diff --git a/0007-RH-Make-build-system-RH-Fedora-friendly.patch b/0003-RH-Make-build-system-RH-Fedora-friendly.patch similarity index 100% rename from 0007-RH-Make-build-system-RH-Fedora-friendly.patch rename to 0003-RH-Make-build-system-RH-Fedora-friendly.patch diff --git a/0003-RH-add-followover.patch b/0003-RH-add-followover.patch deleted file mode 100644 index 9aeecf4..0000000 --- a/0003-RH-add-followover.patch +++ /dev/null @@ -1,235 +0,0 @@ ---- - libmultipath/dict.c | 12 ++++++++++++ - libmultipath/discovery.c | 6 +++--- - libmultipath/print.c | 2 ++ - libmultipath/structs.h | 4 +++- - multipath/main.c | 2 +- - multipath/multipath.conf.5 | 5 +++++ - multipathd/main.c | 35 ++++++++++++++++++++++++++++++++++- - 7 files changed, 60 insertions(+), 6 deletions(-) - -Index: multipath-tools-120518/libmultipath/dict.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/dict.c -+++ multipath-tools-120518/libmultipath/dict.c -@@ -398,6 +398,8 @@ default_failback_handler(vector strvec) - conf->pgfailback = -FAILBACK_MANUAL; - else if (strlen(buff) == 9 && !strcmp(buff, "immediate")) - conf->pgfailback = -FAILBACK_IMMEDIATE; -+ else if (strlen(buff) == 10 && !strcmp(buff, "followover")) -+ conf->pgfailback = -FAILBACK_FOLLOWOVER; - else - conf->pgfailback = atoi(buff); - -@@ -1053,6 +1055,8 @@ hw_failback_handler(vector strvec) - hwe->pgfailback = -FAILBACK_MANUAL; - else if (strlen(buff) == 9 && !strcmp(buff, "immediate")) - hwe->pgfailback = -FAILBACK_IMMEDIATE; -+ else if (strlen(buff) == 10 && !strcmp(buff, "followover")) -+ hwe->pgfailback = -FAILBACK_FOLLOWOVER; - else - hwe->pgfailback = atoi(buff); - -@@ -1351,6 +1355,8 @@ mp_failback_handler(vector strvec) - mpe->pgfailback = -FAILBACK_MANUAL; - else if (strlen(buff) == 9 && !strcmp(buff, "immediate")) - mpe->pgfailback = -FAILBACK_IMMEDIATE; -+ else if (strlen(buff) == 10 && !strcmp(buff, "followover")) -+ mpe->pgfailback = -FAILBACK_FOLLOWOVER; - else - mpe->pgfailback = atoi(buff); - -@@ -1769,6 +1775,8 @@ snprint_mp_failback (char * buff, int le - return snprintf(buff, len, "manual"); - case -FAILBACK_IMMEDIATE: - return snprintf(buff, len, "immediate"); -+ case -FAILBACK_FOLLOWOVER: -+ return snprintf(buff, len, "followover"); - default: - return snprintf(buff, len, "%i", mpe->pgfailback); - } -@@ -2130,6 +2138,8 @@ snprint_hw_failback (char * buff, int le - return snprintf(buff, len, "manual"); - case -FAILBACK_IMMEDIATE: - return snprintf(buff, len, "immediate"); -+ case -FAILBACK_FOLLOWOVER: -+ return snprintf(buff, len, "followover"); - default: - return snprintf(buff, len, "%i", hwe->pgfailback); - } -@@ -2394,6 +2404,8 @@ snprint_def_failback (char * buff, int l - return snprintf(buff, len, "manual"); - case -FAILBACK_IMMEDIATE: - return snprintf(buff, len, "immediate"); -+ case -FAILBACK_FOLLOWOVER: -+ return snprintf(buff, len, "followover"); - default: - return snprintf(buff, len, "%i", conf->pgfailback); - } -Index: multipath-tools-120518/libmultipath/print.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/print.c -+++ multipath-tools-120518/libmultipath/print.c -@@ -143,6 +143,8 @@ snprint_failback (char * buff, size_t le - { - if (mpp->pgfailback == -FAILBACK_IMMEDIATE) - return snprintf(buff, len, "immediate"); -+ if (mpp->pgfailback == -FAILBACK_FOLLOWOVER) -+ return snprintf(buff, len, "followover"); - - if (!mpp->failback_tick) - return snprintf(buff, len, "-"); -Index: multipath-tools-120518/libmultipath/structs.h -=================================================================== ---- multipath-tools-120518.orig/libmultipath/structs.h -+++ multipath-tools-120518/libmultipath/structs.h -@@ -39,7 +39,8 @@ enum rr_weight_mode { - enum failback_mode { - FAILBACK_UNDEF, - FAILBACK_MANUAL, -- FAILBACK_IMMEDIATE -+ FAILBACK_IMMEDIATE, -+ FAILBACK_FOLLOWOVER - }; - - enum sysfs_buses { -@@ -151,6 +152,7 @@ struct path { - int offline; - int state; - int dmstate; -+ int chkrstate; - int failcount; - int priority; - int pgindex; -Index: multipath-tools-120518/multipathd/main.c -=================================================================== ---- multipath-tools-120518.orig/multipathd/main.c -+++ multipath-tools-120518/multipathd/main.c -@@ -995,6 +995,32 @@ mpvec_garbage_collector (struct vectors - } - } - -+/* This is called after a path has started working again. It the multipath -+ * device for this path uses the followover failback type, and this is the -+ * best pathgroup, and this is the first path in the pathgroup to come back -+ * up, then switch to this pathgroup */ -+static int -+followover_should_failback(struct path * pp) -+{ -+ struct pathgroup * pgp; -+ struct path *pp1; -+ int i; -+ -+ if (pp->mpp->pgfailback != -FAILBACK_FOLLOWOVER || -+ !pp->mpp->pg || !pp->pgindex || -+ pp->pgindex != pp->mpp->bestpg) -+ return 0; -+ -+ pgp = VECTOR_SLOT(pp->mpp->pg, pp->pgindex - 1); -+ vector_foreach_slot(pgp->paths, pp1, i) { -+ if (pp1 == pp) -+ continue; -+ if (pp1->chkrstate != PATH_DOWN && pp1->chkrstate != PATH_SHAKY) -+ return 0; -+ } -+ return 1; -+} -+ - static void - defered_failback_tick (vector mpvec) - { -@@ -1092,6 +1118,8 @@ check_path (struct vectors * vecs, struc - { - int newstate; - int new_path_up = 0; -+ int chkr_new_path_up = 0; -+ int oldchkrstate = pp->chkrstate; - - if (!pp->mpp) - return; -@@ -1130,6 +1158,7 @@ check_path (struct vectors * vecs, struc - pp->dev); - pp->dmstate = PSTATE_UNDEF; - } -+ pp->chkrstate = newstate; - if (newstate != pp->state) { - int oldstate = pp->state; - pp->state = newstate; -@@ -1182,6 +1211,9 @@ check_path (struct vectors * vecs, struc - - new_path_up = 1; - -+ if (oldchkrstate != PATH_UP && oldchkrstate != PATH_GHOST) -+ chkr_new_path_up = 1; -+ - /* - * if at least one path is up in a group, and - * the group is disabled, re-enable it -@@ -1233,7 +1265,8 @@ check_path (struct vectors * vecs, struc - (new_path_up || pp->mpp->failback_tick <= 0)) - pp->mpp->failback_tick = - pp->mpp->pgfailback + 1; -- else if (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE) -+ else if (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE || -+ (chkr_new_path_up && followover_should_failback(pp))) - switch_pathgroup(pp->mpp); - } - } -Index: multipath-tools-120518/multipath/multipath.conf.5 -=================================================================== ---- multipath-tools-120518.orig/multipath/multipath.conf.5 -+++ multipath-tools-120518/multipath/multipath.conf.5 -@@ -254,6 +254,11 @@ active paths. - .B manual - Do not perform automatic failback. - .TP -+.B followover -+Only perform automatic failback when the first path of a pathgroup -+becomes active. This keeps a node from automatically failing back when -+another node requested the failover. -+.TP - .B values > 0 - deferred failback (time to defer in seconds) - .TP -Index: multipath-tools-120518/libmultipath/discovery.c -=================================================================== ---- multipath-tools-120518.orig/libmultipath/discovery.c -+++ multipath-tools-120518/libmultipath/discovery.c -@@ -878,13 +878,13 @@ pathinfo (struct path *pp, vector hwtabl - - if (mask & DI_CHECKER) { - if (path_state == PATH_UP) { -- pp->state = get_state(pp, 0); -+ pp->chkrstate = pp->state = get_state(pp, 0); - if (pp->state == PATH_UNCHECKED || - pp->state == PATH_WILD) - goto blank; - } else { - condlog(3, "%s: path inaccessible", pp->dev); -- pp->state = path_state; -+ pp->chkrstate = pp->state = path_state; - } - } - -@@ -912,7 +912,7 @@ blank: - * Recoverable error, for example faulty or offline path - */ - memset(pp->wwid, 0, WWID_SIZE); -- pp->state = PATH_DOWN; -+ pp->chkrstate = pp->state = PATH_DOWN; - - return 0; - } -Index: multipath-tools-120518/multipath/main.c -=================================================================== ---- multipath-tools-120518.orig/multipath/main.c -+++ multipath-tools-120518/multipath/main.c -@@ -144,7 +144,7 @@ update_paths (struct multipath * mpp) - /* - * path is not in sysfs anymore - */ -- pp->state = PATH_DOWN; -+ pp->chkrstate = pp->state = PATH_DOWN; - continue; - } - pp->mpp = mpp; diff --git a/0004-RH-fix-cciss-names.patch b/0004-RH-fix-cciss-names.patch deleted file mode 100644 index 890a483..0000000 --- a/0004-RH-fix-cciss-names.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- - multipath/main.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -Index: multipath-tools-120518/multipath/main.c -=================================================================== ---- multipath-tools-120518.orig/multipath/main.c -+++ multipath-tools-120518/multipath/main.c -@@ -409,6 +409,16 @@ get_dev_type(char *dev) { - return DEV_DEVMAP; - } - -+static void -+convert_dev(char *dev) -+{ -+ char *ptr = strstr(dev, "cciss/"); -+ if (ptr) { -+ ptr += 5; -+ *ptr = '!'; -+ } -+} -+ - int - main (int argc, char *argv[]) - { -@@ -514,6 +524,8 @@ main (int argc, char *argv[]) - - strncpy(conf->dev, argv[optind], FILE_NAME_SIZE); - conf->dev_type = get_dev_type(conf->dev); -+ if (conf->dev_type == DEV_DEVNODE) -+ convert_dev(conf->dev); - } - conf->daemon = 0; - diff --git a/0008-RH-multipathd-blacklist-all-by-default.patch b/0004-RH-multipathd-blacklist-all-by-default.patch similarity index 83% rename from 0008-RH-multipathd-blacklist-all-by-default.patch rename to 0004-RH-multipathd-blacklist-all-by-default.patch index 5bbf3ca..e27e4cf 100644 --- a/0008-RH-multipathd-blacklist-all-by-default.patch +++ b/0004-RH-multipathd-blacklist-all-by-default.patch @@ -16,10 +16,10 @@ Signed-off-by: Fabio M. Di Nitto libmultipath/config.h | 1 + 2 files changed, 17 insertions(+) -Index: multipath-tools-120518/libmultipath/config.c +Index: multipath-tools-120817/libmultipath/config.c =================================================================== ---- multipath-tools-120518.orig/libmultipath/config.c -+++ multipath-tools-120518/libmultipath/config.c +--- multipath-tools-120817.orig/libmultipath/config.c ++++ multipath-tools-120817/libmultipath/config.c @@ -21,6 +21,7 @@ #include "defaults.h" #include "prio.h" @@ -28,7 +28,7 @@ Index: multipath-tools-120518/libmultipath/config.c static int hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) -@@ -549,6 +550,21 @@ load_config (char * file) +@@ -552,6 +553,21 @@ load_config (char * file) } else { init_keywords(); @@ -50,10 +50,10 @@ Index: multipath-tools-120518/libmultipath/config.c } /* -Index: multipath-tools-120518/libmultipath/config.h +Index: multipath-tools-120817/libmultipath/config.h =================================================================== ---- multipath-tools-120518.orig/libmultipath/config.h -+++ multipath-tools-120518/libmultipath/config.h +--- multipath-tools-120817.orig/libmultipath/config.h ++++ multipath-tools-120817/libmultipath/config.h @@ -6,6 +6,7 @@ #define ORIGIN_DEFAULT 0 diff --git a/0009-RH-add-mpathconf.patch b/0005-RH-add-mpathconf.patch similarity index 95% rename from 0009-RH-add-mpathconf.patch rename to 0005-RH-add-mpathconf.patch index 2a5bec8..6cd9543 100644 --- a/0009-RH-add-mpathconf.patch +++ b/0005-RH-add-mpathconf.patch @@ -6,11 +6,11 @@ multipath/mpathconf.8 | 103 ++++++++++++++++ 5 files changed, 423 insertions(+), 2 deletions(-) -Index: multipath-tools-120613/libmultipath/config.c +Index: multipath-tools-120817/libmultipath/config.c =================================================================== ---- multipath-tools-120613.orig/libmultipath/config.c -+++ multipath-tools-120613/libmultipath/config.c -@@ -553,6 +553,7 @@ load_config (char * file) +--- multipath-tools-120817.orig/libmultipath/config.c ++++ multipath-tools-120817/libmultipath/config.c +@@ -556,6 +556,7 @@ load_config (char * file) condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); condlog(0, "A default multipath.conf file is located at"); condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); @@ -18,10 +18,10 @@ Index: multipath-tools-120613/libmultipath/config.c if (conf->blist_devnode == NULL) { conf->blist_devnode = vector_alloc(); if (!conf->blist_devnode) { -Index: multipath-tools-120613/multipath/Makefile +Index: multipath-tools-120817/multipath/Makefile =================================================================== ---- multipath-tools-120613.orig/multipath/Makefile -+++ multipath-tools-120613/multipath/Makefile +--- multipath-tools-120817.orig/multipath/Makefile ++++ multipath-tools-120817/multipath/Makefile @@ -17,22 +17,27 @@ $(EXEC): $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(GZIP) $(EXEC).8 > $(EXEC).8.gz @@ -50,10 +50,10 @@ Index: multipath-tools-120613/multipath/Makefile clean: rm -f core *.o $(EXEC) *.gz -Index: multipath-tools-120613/multipath/main.c +Index: multipath-tools-120817/multipath/main.c =================================================================== ---- multipath-tools-120613.orig/multipath/main.c -+++ multipath-tools-120613/multipath/main.c +--- multipath-tools-120817.orig/multipath/main.c ++++ multipath-tools-120817/multipath/main.c @@ -432,10 +432,10 @@ main (int argc, char *argv[]) exit(1); } @@ -67,10 +67,10 @@ Index: multipath-tools-120613/multipath/main.c exit(1); while ((arg = getopt(argc, argv, ":dchl::FfM:v:p:b:Brtq")) != EOF ) { -Index: multipath-tools-120613/multipath/mpathconf +Index: multipath-tools-120817/multipath/mpathconf =================================================================== --- /dev/null -+++ multipath-tools-120613/multipath/mpathconf ++++ multipath-tools-120817/multipath/mpathconf @@ -0,0 +1,312 @@ +#!/bin/sh +# @@ -384,10 +384,10 @@ Index: multipath-tools-120613/multipath/mpathconf +elif [ -n "$CHANGED_CONFIG" -a "$HAVE_MULTIPATHD" = 1 ]; then + service multipathd reload +fi -Index: multipath-tools-120613/multipath/mpathconf.8 +Index: multipath-tools-120817/multipath/mpathconf.8 =================================================================== --- /dev/null -+++ multipath-tools-120613/multipath/mpathconf.8 ++++ multipath-tools-120817/multipath/mpathconf.8 @@ -0,0 +1,103 @@ +.TH MPATHCONF 8 "June 2010" "" "Linux Administrator's Manual" +.SH NAME diff --git a/0010-RH-add-find-multipaths.patch b/0006-RH-add-find-multipaths.patch similarity index 75% rename from 0010-RH-add-find-multipaths.patch rename to 0006-RH-add-find-multipaths.patch index 57eb0a8..7c1e492 100644 --- a/0010-RH-add-find-multipaths.patch +++ b/0006-RH-add-find-multipaths.patch @@ -10,11 +10,11 @@ multipathd/main.c | 6 ++++++ 9 files changed, 82 insertions(+), 1 deletion(-) -Index: multipath-tools-120518/libmultipath/config.c +Index: multipath-tools-120817/libmultipath/config.c =================================================================== ---- multipath-tools-120518.orig/libmultipath/config.c -+++ multipath-tools-120518/libmultipath/config.c -@@ -514,6 +514,7 @@ load_config (char * file) +--- multipath-tools-120817.orig/libmultipath/config.c ++++ multipath-tools-120817/libmultipath/config.c +@@ -517,6 +517,7 @@ load_config (char * file) conf->reassign_maps = DEFAULT_REASSIGN_MAPS; conf->checkint = DEFAULT_CHECKINT; conf->max_checkint = MAX_CHECKINT(conf->checkint); @@ -22,11 +22,11 @@ Index: multipath-tools-120518/libmultipath/config.c /* * preload default hwtable -Index: multipath-tools-120518/libmultipath/configure.c +Index: multipath-tools-120817/libmultipath/configure.c =================================================================== ---- multipath-tools-120518.orig/libmultipath/configure.c -+++ multipath-tools-120518/libmultipath/configure.c -@@ -497,6 +497,10 @@ coalesce_paths (struct vectors * vecs, v +--- multipath-tools-120817.orig/libmultipath/configure.c ++++ multipath-tools-120817/libmultipath/configure.c +@@ -505,6 +505,10 @@ coalesce_paths (struct vectors * vecs, v memset(empty_buff, 0, WWID_SIZE); @@ -37,7 +37,7 @@ Index: multipath-tools-120518/libmultipath/configure.c if (force_reload) { vector_foreach_slot (pathvec, pp1, k) { pp1->mpp = NULL; -@@ -526,6 +530,13 @@ coalesce_paths (struct vectors * vecs, v +@@ -534,6 +538,13 @@ coalesce_paths (struct vectors * vecs, v if (refwwid && strncmp(pp1->wwid, refwwid, WWID_SIZE)) continue; @@ -51,10 +51,10 @@ Index: multipath-tools-120518/libmultipath/configure.c /* * at this point, we know we really got a new mp */ -Index: multipath-tools-120518/libmultipath/defaults.h +Index: multipath-tools-120817/libmultipath/defaults.h =================================================================== ---- multipath-tools-120518.orig/libmultipath/defaults.h -+++ multipath-tools-120518/libmultipath/defaults.h +--- multipath-tools-120817.orig/libmultipath/defaults.h ++++ multipath-tools-120817/libmultipath/defaults.h @@ -15,6 +15,7 @@ #define DEFAULT_USER_FRIENDLY_NAMES 0 #define DEFAULT_VERBOSITY 2 @@ -63,10 +63,10 @@ Index: multipath-tools-120518/libmultipath/defaults.h #define DEFAULT_CHECKINT 5 #define MAX_CHECKINT(a) (a << 2) -Index: multipath-tools-120518/libmultipath/dict.c +Index: multipath-tools-120817/libmultipath/dict.c =================================================================== ---- multipath-tools-120518.orig/libmultipath/dict.c -+++ multipath-tools-120518/libmultipath/dict.c +--- multipath-tools-120817.orig/libmultipath/dict.c ++++ multipath-tools-120817/libmultipath/dict.c @@ -585,6 +585,27 @@ def_reservation_key_handler(vector strve } @@ -95,7 +95,7 @@ Index: multipath-tools-120518/libmultipath/dict.c def_names_handler(vector strvec) { char * buff; -@@ -2549,6 +2570,18 @@ snprint_def_log_checker_err (char * buff +@@ -2560,6 +2581,18 @@ snprint_def_log_checker_err (char * buff } static int @@ -114,19 +114,19 @@ Index: multipath-tools-120518/libmultipath/dict.c snprint_def_user_friendly_names (char * buff, int len, void * data) { if (conf->user_friendly_names == USER_FRIENDLY_NAMES_ON) -@@ -2646,6 +2679,7 @@ init_keywords(void) - install_keyword("bindings_file", &bindings_file_handler, &snprint_def_bindings_file); +@@ -2662,6 +2695,7 @@ init_keywords(void) + install_keyword("wwids_file", &wwids_file_handler, &snprint_def_wwids_file); install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err); install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key); + install_keyword("find_multipaths", &def_find_multipaths_handler, &snprint_def_find_multipaths); __deprecated install_keyword("default_selector", &def_selector_handler, NULL); __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); -Index: multipath-tools-120518/libmultipath/wwids.c +Index: multipath-tools-120817/libmultipath/wwids.c =================================================================== ---- multipath-tools-120518.orig/libmultipath/wwids.c -+++ multipath-tools-120518/libmultipath/wwids.c -@@ -124,6 +124,32 @@ out: +--- multipath-tools-120817.orig/libmultipath/wwids.c ++++ multipath-tools-120817/libmultipath/wwids.c +@@ -125,6 +125,32 @@ out: } int @@ -159,10 +159,10 @@ Index: multipath-tools-120518/libmultipath/wwids.c remember_wwid(char *wwid) { int ret = check_wwids_file(wwid, 1); -Index: multipath-tools-120518/libmultipath/wwids.h +Index: multipath-tools-120817/libmultipath/wwids.h =================================================================== ---- multipath-tools-120518.orig/libmultipath/wwids.h -+++ multipath-tools-120518/libmultipath/wwids.h +--- multipath-tools-120817.orig/libmultipath/wwids.h ++++ multipath-tools-120817/libmultipath/wwids.h @@ -12,6 +12,7 @@ "#\n" \ "# Valid WWIDs:\n" @@ -171,10 +171,10 @@ Index: multipath-tools-120518/libmultipath/wwids.h int remember_wwid(char *wwid); int check_wwids_file(char *wwid, int write_wwid); -Index: multipath-tools-120518/multipath/main.c +Index: multipath-tools-120817/multipath/main.c =================================================================== ---- multipath-tools-120518.orig/multipath/main.c -+++ multipath-tools-120518/multipath/main.c +--- multipath-tools-120817.orig/multipath/main.c ++++ multipath-tools-120817/multipath/main.c @@ -332,7 +332,7 @@ configure (void) /* * core logic entry point @@ -184,10 +184,10 @@ Index: multipath-tools-120518/multipath/main.c out: if (refwwid) -Index: multipath-tools-120518/multipathd/main.c +Index: multipath-tools-120817/multipathd/main.c =================================================================== ---- multipath-tools-120518.orig/multipathd/main.c -+++ multipath-tools-120518/multipathd/main.c +--- multipath-tools-120817.orig/multipathd/main.c ++++ multipath-tools-120817/multipathd/main.c @@ -49,6 +49,7 @@ #include #include @@ -208,10 +208,10 @@ Index: multipath-tools-120518/multipathd/main.c condlog(4,"%s: creating new map", pp->dev); if ((mpp = add_map_with_path(vecs, pp, 1))) { mpp->action = ACT_CREATE; -Index: multipath-tools-120518/libmultipath/config.h +Index: multipath-tools-120817/libmultipath/config.h =================================================================== ---- multipath-tools-120518.orig/libmultipath/config.h -+++ multipath-tools-120518/libmultipath/config.h +--- multipath-tools-120817.orig/libmultipath/config.h ++++ multipath-tools-120817/libmultipath/config.h @@ -104,6 +104,7 @@ struct config { unsigned int dev_loss; int log_checker_err; diff --git a/0011-RH-add-hp_tur-checker.patch b/0007-RH-add-hp_tur-checker.patch similarity index 100% rename from 0011-RH-add-hp_tur-checker.patch rename to 0007-RH-add-hp_tur-checker.patch diff --git a/0012-RH-RHEL5-style-partitions.patch b/0008-RH-RHEL5-style-partitions.patch similarity index 100% rename from 0012-RH-RHEL5-style-partitions.patch rename to 0008-RH-RHEL5-style-partitions.patch diff --git a/0013-RH-dont-remove-map-on-enomem.patch b/0009-RH-dont-remove-map-on-enomem.patch similarity index 100% rename from 0013-RH-dont-remove-map-on-enomem.patch rename to 0009-RH-dont-remove-map-on-enomem.patch diff --git a/0014-RH-deprecate-uid-gid-mode.patch b/0010-RH-deprecate-uid-gid-mode.patch similarity index 100% rename from 0014-RH-deprecate-uid-gid-mode.patch rename to 0010-RH-deprecate-uid-gid-mode.patch diff --git a/0015-RH-use-sync-support.patch b/0011-RH-use-sync-support.patch similarity index 100% rename from 0015-RH-use-sync-support.patch rename to 0011-RH-use-sync-support.patch diff --git a/0016-RH-change-configs.patch b/0012-RH-change-configs.patch similarity index 98% rename from 0016-RH-change-configs.patch rename to 0012-RH-change-configs.patch index 7942ea8..c34f492 100644 --- a/0016-RH-change-configs.patch +++ b/0012-RH-change-configs.patch @@ -3,11 +3,11 @@ libmultipath/hwtable.c | 65 ------------------------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) -Index: multipath-tools-120613/libmultipath/config.c +Index: multipath-tools-120817/libmultipath/config.c =================================================================== ---- multipath-tools-120613.orig/libmultipath/config.c -+++ multipath-tools-120613/libmultipath/config.c -@@ -515,6 +515,7 @@ load_config (char * file) +--- multipath-tools-120817.orig/libmultipath/config.c ++++ multipath-tools-120817/libmultipath/config.c +@@ -518,6 +518,7 @@ load_config (char * file) conf->checkint = DEFAULT_CHECKINT; conf->max_checkint = MAX_CHECKINT(conf->checkint); conf->find_multipaths = DEFAULT_FIND_MULTIPATHS; @@ -15,10 +15,10 @@ Index: multipath-tools-120613/libmultipath/config.c /* * preload default hwtable -Index: multipath-tools-120613/libmultipath/hwtable.c +Index: multipath-tools-120817/libmultipath/hwtable.c =================================================================== ---- multipath-tools-120613.orig/libmultipath/hwtable.c -+++ multipath-tools-120613/libmultipath/hwtable.c +--- multipath-tools-120817.orig/libmultipath/hwtable.c ++++ multipath-tools-120817/libmultipath/hwtable.c @@ -28,7 +28,6 @@ static struct hwentry default_hw[] = { .product = "Compellent Vol", .features = DEFAULT_FEATURES, diff --git a/0013-RH-kpartx-msg.patch b/0013-RH-kpartx-msg.patch new file mode 100644 index 0000000..4040049 --- /dev/null +++ b/0013-RH-kpartx-msg.patch @@ -0,0 +1,24 @@ +--- + kpartx/lopart.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: multipath-tools-120821/kpartx/lopart.c +=================================================================== +--- multipath-tools-120821.orig/kpartx/lopart.c ++++ multipath-tools-120821/kpartx/lopart.c +@@ -216,13 +216,13 @@ find_unused_loop_device (void) + fprintf(stderr, + "mount: Could not find any loop device, and, according to %s,\n" + " this kernel does not know about the loop device.\n" +- " (If so, then recompile or `insmod loop.o'.)", ++ " (If so, then recompile or `modprobe loop'.)", + PROC_DEVICES); + + else + fprintf(stderr, + "mount: Could not find any loop device. Maybe this kernel does not know\n" +- " about the loop device (then recompile or `insmod loop.o'), or\n" ++ " about the loop device (then recompile or `modprobe loop'), or\n" + " maybe /dev/loop# has the wrong major number?"); + + } else diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index ad874c6..68887b3 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,29 +1,26 @@ Summary: Tools to manage multipath devices using device-mapper Name: device-mapper-multipath Version: 0.4.9 -Release: 28%{?dist} +Release: 29%{?dist} License: GPL+ Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ -Source0: multipath-tools-120613.tgz +Source0: multipath-tools-120821.tgz Source1: multipath.conf -Patch0001: 0001-RH-remove_callout.patch -Patch0002: 0002-RH-add-wwids-file.patch -Patch0003: 0003-RH-add-followover.patch -Patch0004: 0004-RH-fix-cciss-names.patch -Patch0005: 0005-RH-dont_start_with_no_config.patch -Patch0006: 0006-RH-multipath.rules.patch -Patch0007: 0007-RH-Make-build-system-RH-Fedora-friendly.patch -Patch0008: 0008-RH-multipathd-blacklist-all-by-default.patch -Patch0009: 0009-RH-add-mpathconf.patch -Patch0010: 0010-RH-add-find-multipaths.patch -Patch0011: 0011-RH-add-hp_tur-checker.patch -Patch0012: 0012-RH-RHEL5-style-partitions.patch -Patch0013: 0013-RH-dont-remove-map-on-enomem.patch -Patch0014: 0014-RH-deprecate-uid-gid-mode.patch -Patch0015: 0015-RH-use-sync-support.patch -Patch0016: 0016-RH-change-configs.patch +Patch0001: 0001-RH-dont_start_with_no_config.patch +Patch0002: 0002-RH-multipath.rules.patch +Patch0003: 0003-RH-Make-build-system-RH-Fedora-friendly.patch +Patch0004: 0004-RH-multipathd-blacklist-all-by-default.patch +Patch0005: 0005-RH-add-mpathconf.patch +Patch0006: 0006-RH-add-find-multipaths.patch +Patch0007: 0007-RH-add-hp_tur-checker.patch +Patch0008: 0008-RH-RHEL5-style-partitions.patch +Patch0009: 0009-RH-dont-remove-map-on-enomem.patch +Patch0010: 0010-RH-deprecate-uid-gid-mode.patch +Patch0011: 0011-RH-use-sync-support.patch +Patch0012: 0012-RH-change-configs.patch +Patch0013: 0013-RH-kpartx-msg.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -75,7 +72,7 @@ Group: System Environment/Base kpartx manages partition creation and removal for device-mapper devices. %prep -%setup -q -n multipath-tools-120613 +%setup -q -n multipath-tools-120821 %patch0001 -p1 %patch0002 -p1 %patch0003 -p1 @@ -89,9 +86,6 @@ kpartx manages partition creation and removal for device-mapper devices. %patch0011 -p1 %patch0012 -p1 %patch0013 -p1 -%patch0014 -p1 -%patch0015 -p1 -%patch0016 -p1 cp %{SOURCE1} . %build @@ -186,6 +180,15 @@ bin/systemctl --no-reload enable multipathd.service >/dev/null 2>&1 ||: %{_mandir}/man8/kpartx.8.gz %changelog +* Tue Aug 21 2012 Benjamin Marzinski 0.4.9-29 +- Updated to latest upstrem 0.4.9 code: multipath-tools-120821.tgz + (git commit id: 050b24b33d3c60e29f7820d2fb75e84a9edde528) + * includes 0001-RH-remove_callout.patch, 0002-RH-add-wwids-file.patch, + 0003-RH-add-followover.patch, 0004-RH-fix-cciss-names.patch +- Add 0013-RH-kpartx-msg.patch +- Modify 0002-RH-multipath.rules.patch + * removed socket call from rules file + * Wed Jul 18 2012 Fedora Release Engineering - 0.4.9-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/sources b/sources index 38f8bfd..1003511 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -84632b08dbca9fa04179edd8c469c92a multipath-tools-120613.tgz +7115cfd8ebcf6a005299c18f00aac575 multipath-tools-120821.tgz