[device-mapper-multipath/f20] device-mapper-multipath-0.4.9-56.fc20
Benjamin Marzinski
bmarzins at fedoraproject.org
Mon Jan 13 19:59:11 UTC 2014
commit bb05a9d06aea152e531a28557812e4120201dcbf
Author: Benjamin Marzinski <bmarzins at redhat.com>
Date: Mon Jan 13 07:56:01 2014 -0600
device-mapper-multipath-0.4.9-56.fc20
Add 0061-RH-display-find-mpaths.patch
* display the find_multipaths value in show config
Add 0062-RH-dont-free-vecs.patch
* don't free the vecs structure on shutdown. It's more pain than
it's worth.
Add 0063-RH-fix-warning.patch
* Fix complier warning
Add 0065-UPBZ-995538-fail-rdac-on-unavailable.patch
* make rdac checker always mark paths with asymmetric access state of
unavailable as down
Add 0066-UP-dos-4k-partition-fix.patch
* Make kpartx correctly handle 4K sector size devices with dos partitions.
Add 0069-UPBZ-1033791-improve-rdac-checker.patch
* Use RTPG data in RDAC checker
Add 0070-RHBZ-1036503-blacklist-td-devs.patch
Add 0071-RHBZ-1031546-strip-dev.patch
* make multipathd interactive commands able to handle /dev/<devnode>
instead of just <devnode>
Add 0072-RHBZ-1039199-check-loop-control.patch
* Make kpartx use LOOP_CTL_GET_FREE and loop-control to find a free
loop device. This will autoload the loop module.
Add 0073-RH-update-build-flags.patch
* fix print call to work with -Werror=format-security compile flag
Resolves: bz #1039136
0061-RH-display-find-mpaths.patch | 17 ++
0062-RH-dont-free-vecs.patch | 28 +++
0063-RH-fix-warning.patch | 26 +++
0065-UPBZ-995538-fail-rdac-on-unavailable.patch | 21 ++
0066-UP-dos-4k-partition-fix.patch | 159 +++++++++++++++
0069-UPBZ-1033791-improve-rdac-checker.patch | 153 ++++++++++++++
0070-RHBZ-1036503-blacklist-td-devs.patch | 17 ++
0071-RHBZ-1031546-strip-dev.patch | 248 +++++++++++++++++++++++
0072-RHBZ-1039199-check-loop-control.patch | 46 +++++
0073-RH-update-build-flags.patch | 33 +++
device-mapper-multipath.spec | 48 +++++-
11 files changed, 795 insertions(+), 1 deletions(-)
---
diff --git a/0061-RH-display-find-mpaths.patch b/0061-RH-display-find-mpaths.patch
new file mode 100644
index 0000000..05c63f0
--- /dev/null
+++ b/0061-RH-display-find-mpaths.patch
@@ -0,0 +1,17 @@
+---
+ libmultipath/dict.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+Index: multipath-tools-130222/libmultipath/dict.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/dict.c
++++ multipath-tools-130222/libmultipath/dict.c
+@@ -2717,8 +2717,6 @@ snprint_def_log_checker_err (char * buff
+ static int
+ snprint_def_find_multipaths (char * buff, int len, void * data)
+ {
+- if (conf->find_multipaths == DEFAULT_FIND_MULTIPATHS)
+- return 0;
+ if (!conf->find_multipaths)
+ return snprintf(buff, len, "no");
+
diff --git a/0062-RH-dont-free-vecs.patch b/0062-RH-dont-free-vecs.patch
new file mode 100644
index 0000000..f1c3217
--- /dev/null
+++ b/0062-RH-dont-free-vecs.patch
@@ -0,0 +1,28 @@
+---
+ multipathd/main.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+Index: multipath-tools-130222/multipathd/main.c
+===================================================================
+--- multipath-tools-130222.orig/multipathd/main.c
++++ multipath-tools-130222/multipathd/main.c
+@@ -1735,8 +1735,9 @@ child (void * param)
+ vecs->pathvec = NULL;
+ unlock(vecs->lock);
+ /* Now all the waitevent threads will start rushing in. */
++ /* freeing vecs isn't worth the races
+ while (vecs->lock.depth > 0) {
+- sleep (1); /* This is weak. */
++ sleep (1);
+ condlog(3, "Have %d wait event checkers threads to de-alloc,"
+ " waiting...", vecs->lock.depth);
+ }
+@@ -1746,7 +1747,7 @@ child (void * param)
+ vecs->lock.mutex = NULL;
+ FREE(vecs);
+ vecs = NULL;
+-
++ */
+ cleanup_checkers();
+ cleanup_prio();
+
diff --git a/0063-RH-fix-warning.patch b/0063-RH-fix-warning.patch
new file mode 100644
index 0000000..7db8056
--- /dev/null
+++ b/0063-RH-fix-warning.patch
@@ -0,0 +1,26 @@
+---
+ kpartx/dasd.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: multipath-tools-130222/kpartx/dasd.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/dasd.c
++++ multipath-tools-130222/kpartx/dasd.c
+@@ -46,6 +46,8 @@ unsigned long long sectors512(unsigned l
+ return sectors * (blocksize >> 9);
+ }
+
++typedef unsigned int __attribute__((__may_alias__)) label_ints_t;
++
+ /*
+ */
+ int
+@@ -169,7 +171,7 @@ read_dasd_pt(int fd, struct slice all, s
+ /*
+ * VM style CMS1 labeled disk
+ */
+- unsigned int *label = (unsigned int *) &vlabel;
++ label_ints_t *label = (label_ints_t *) &vlabel;
+
+ blocksize = label[4];
+ if (label[14] != 0) {
diff --git a/0065-UPBZ-995538-fail-rdac-on-unavailable.patch b/0065-UPBZ-995538-fail-rdac-on-unavailable.patch
new file mode 100644
index 0000000..ca72b61
--- /dev/null
+++ b/0065-UPBZ-995538-fail-rdac-on-unavailable.patch
@@ -0,0 +1,21 @@
+---
+ libmultipath/checkers/rdac.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+Index: multipath-tools-130222/libmultipath/checkers/rdac.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/checkers/rdac.c
++++ multipath-tools-130222/libmultipath/checkers/rdac.c
+@@ -222,10 +222,9 @@ libcheck_check (struct checker * c)
+ goto done;
+ }
+
+- /* check if controller is in service mode */
++ /* check if controller is reporting asymmetric access state of unavailable */
+ if ((inq.avtcvp & 0x10) &&
+- ((inq.asym_access_state_cur & 0x0F) == 0x3) &&
+- (inq.vendor_specific_cur == 0x7)) {
++ ((inq.asym_access_state_cur & 0x0F) == 0x3)) {
+ ret = PATH_DOWN;
+ goto done;
+ }
diff --git a/0066-UP-dos-4k-partition-fix.patch b/0066-UP-dos-4k-partition-fix.patch
new file mode 100644
index 0000000..a2d1b44
--- /dev/null
+++ b/0066-UP-dos-4k-partition-fix.patch
@@ -0,0 +1,159 @@
+---
+ kpartx/dos.c | 17 ++++++++++-------
+ kpartx/gpt.c | 20 +-------------------
+ kpartx/kpartx.c | 12 ++++++++++++
+ kpartx/kpartx.h | 8 ++++++++
+ 4 files changed, 31 insertions(+), 26 deletions(-)
+
+Index: multipath-tools-130222/kpartx/dos.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/dos.c
++++ multipath-tools-130222/kpartx/dos.c
+@@ -26,7 +26,9 @@ read_extended_partition(int fd, struct p
+ int moretodo = 1;
+ int i, n=0;
+
+- next = start = le32_to_cpu(ep->start_sect);
++ int sector_size_mul = get_sector_size(fd)/512;
++
++ next = start = sector_size_mul * le32_to_cpu(ep->start_sect);
+
+ while (moretodo) {
+ here = next;
+@@ -45,14 +47,14 @@ read_extended_partition(int fd, struct p
+ memcpy(&p, bp + 0x1be + i * sizeof (p), sizeof (p));
+ if (is_extended(p.sys_type)) {
+ if (p.nr_sects && !moretodo) {
+- next = start + le32_to_cpu(p.start_sect);
++ next = start + sector_size_mul * le32_to_cpu(p.start_sect);
+ moretodo = 1;
+ }
+ continue;
+ }
+ if (n < ns) {
+- sp[n].start = here + le32_to_cpu(p.start_sect);
+- sp[n].size = le32_to_cpu(p.nr_sects);
++ sp[n].start = here + sector_size_mul * le32_to_cpu(p.start_sect);
++ sp[n].size = sector_size_mul * le32_to_cpu(p.nr_sects);
+ n++;
+ } else {
+ fprintf(stderr,
+@@ -76,6 +78,7 @@ read_dos_pt(int fd, struct slice all, st
+ unsigned long offset = all.start;
+ int i, n=4;
+ unsigned char *bp;
++ int sector_size_mul = get_sector_size(fd)/512;
+
+ bp = (unsigned char *)getblock(fd, offset);
+ if (bp == NULL)
+@@ -89,8 +92,8 @@ read_dos_pt(int fd, struct slice all, st
+ if (is_gpt(p.sys_type))
+ return 0;
+ if (i < ns) {
+- sp[i].start = le32_to_cpu(p.start_sect);
+- sp[i].size = le32_to_cpu(p.nr_sects);
++ sp[i].start = sector_size_mul * le32_to_cpu(p.start_sect);
++ sp[i].size = sector_size_mul * le32_to_cpu(p.nr_sects);
+ } else {
+ fprintf(stderr,
+ "dos_partition: too many slices\n");
+@@ -99,7 +102,7 @@ read_dos_pt(int fd, struct slice all, st
+ if (is_extended(p.sys_type)) {
+ n += read_extended_partition(fd, &p, sp+n, ns-n);
+ /* hide the extended partition itself */
+- sp[i].size = 2;
++ sp[i].size = sector_size_mul * 2;
+ }
+ }
+ return n;
+Index: multipath-tools-130222/kpartx/gpt.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/gpt.c
++++ multipath-tools-130222/kpartx/gpt.c
+@@ -38,6 +38,7 @@
+ #include <byteswap.h>
+ #include <linux/fs.h>
+ #include "crc32.h"
++#include "kpartx.h"
+
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ # define __le16_to_cpu(x) (x)
+@@ -116,25 +117,6 @@ is_pmbr_valid(legacy_mbr *mbr)
+
+
+ /************************************************************
+- * get_sector_size
+- * Requires:
+- * - filedes is an open file descriptor, suitable for reading
+- * Modifies: nothing
+- * Returns:
+- * sector size, or 512.
+- ************************************************************/
+-static int
+-get_sector_size(int filedes)
+-{
+- int rc, sector_size = 512;
+-
+- rc = ioctl(filedes, BLKSSZGET, §or_size);
+- if (rc)
+- sector_size = 512;
+- return sector_size;
+-}
+-
+-/************************************************************
+ * _get_num_sectors
+ * Requires:
+ * - filedes is an open file descriptor, suitable for reading
+Index: multipath-tools-130222/kpartx/kpartx.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/kpartx.c
++++ multipath-tools-130222/kpartx/kpartx.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdint.h>
++#include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <ctype.h>
+@@ -606,3 +607,14 @@ getblock (int fd, unsigned int secnr) {
+
+ return bp->block;
+ }
++
++int
++get_sector_size(int filedes)
++{
++ int rc, sector_size = 512;
++
++ rc = ioctl(filedes, BLKSSZGET, §or_size);
++ if (rc)
++ sector_size = 512;
++ return sector_size;
++}
+Index: multipath-tools-130222/kpartx/kpartx.h
+===================================================================
+--- multipath-tools-130222.orig/kpartx/kpartx.h
++++ multipath-tools-130222/kpartx/kpartx.h
+@@ -2,6 +2,7 @@
+ #define _KPARTX_H
+
+ #include <stdint.h>
++#include <sys/ioctl.h>
+
+ /*
+ * For each partition type there is a routine that takes
+@@ -18,6 +19,13 @@
+ #define safe_sprintf(var, format, args...) \
+ snprintf(var, sizeof(var), format, ##args) >= sizeof(var)
+
++#ifndef BLKSSZGET
++#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
++#endif
++
++int
++get_sector_size(int filedes);
++
+ /*
+ * units: 512 byte sectors
+ */
diff --git a/0069-UPBZ-1033791-improve-rdac-checker.patch b/0069-UPBZ-1033791-improve-rdac-checker.patch
new file mode 100644
index 0000000..c838f29
--- /dev/null
+++ b/0069-UPBZ-1033791-improve-rdac-checker.patch
@@ -0,0 +1,153 @@
+---
+ libmultipath/checkers/rdac.c | 91 ++++++++++++++++++++++++++++++++++++++-----
+ libmultipath/discovery.c | 2
+ 2 files changed, 81 insertions(+), 12 deletions(-)
+
+Index: multipath-tools-130222/libmultipath/checkers/rdac.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/checkers/rdac.c
++++ multipath-tools-130222/libmultipath/checkers/rdac.c
+@@ -34,6 +34,18 @@
+ #define MSG_RDAC_UP "rdac checker reports path is up"
+ #define MSG_RDAC_DOWN "rdac checker reports path is down"
+ #define MSG_RDAC_GHOST "rdac checker reports path is ghost"
++#define MSG_RDAC_DOWN_TYPE(STR) MSG_RDAC_DOWN": "STR
++
++#define RTPG_UNAVAILABLE 0x3
++#define RTPG_OFFLINE 0xE
++#define RTPG_TRANSITIONING 0xF
++
++#define RTPG_UNAVAIL_NON_RESPONSIVE 0x2
++#define RTPG_UNAVAIL_IN_RESET 0x3
++#define RTPG_UNAVAIL_CFW_DL1 0x4
++#define RTPG_UNAVAIL_CFW_DL2 0x5
++#define RTPG_UNAVAIL_QUIESCED 0x6
++#define RTPG_UNAVAIL_SERVICE_MODE 0x7
+
+ struct control_mode_page {
+ unsigned char header[8];
+@@ -199,22 +211,64 @@ struct volume_access_inq
+ char PQ_PDT;
+ char dontcare0[7];
+ char avtcvp;
+- char dontcare1;
+- char asym_access_state_cur;
++ char vol_ppp;
++ char aas_cur;
+ char vendor_specific_cur;
+- char dontcare2[36];
++ char aas_alt;
++ char vendor_specific_alt;
++ char dontcare1[34];
+ };
+
++const char
++*checker_msg_string(struct volume_access_inq *inq)
++{
++ /* lun not connected */
++ if (((inq->PQ_PDT & 0xE0) == 0x20) || (inq->PQ_PDT & 0x7f))
++ return MSG_RDAC_DOWN_TYPE("lun not connected");
++
++ /* if no tpg data is available, give the generic path down message */
++ if (!(inq->avtcvp & 0x10))
++ return MSG_RDAC_DOWN;
++
++ /* controller is booting up */
++ if (((inq->aas_cur & 0x0F) == RTPG_TRANSITIONING) &&
++ (inq->aas_alt & 0x0F) != RTPG_TRANSITIONING)
++ return MSG_RDAC_DOWN_TYPE("ctlr is in startup sequence");
++
++ /* if not unavailable, give generic message */
++ if ((inq->aas_cur & 0x0F) != RTPG_UNAVAILABLE)
++ return MSG_RDAC_DOWN;
++
++ /* target port group unavailable */
++ switch (inq->vendor_specific_cur) {
++ case RTPG_UNAVAIL_NON_RESPONSIVE:
++ return MSG_RDAC_DOWN_TYPE("non-responsive to queries");
++ case RTPG_UNAVAIL_IN_RESET:
++ return MSG_RDAC_DOWN_TYPE("ctlr held in reset");
++ case RTPG_UNAVAIL_CFW_DL1:
++ case RTPG_UNAVAIL_CFW_DL2:
++ return MSG_RDAC_DOWN_TYPE("ctlr firmware downloading");
++ case RTPG_UNAVAIL_QUIESCED:
++ return MSG_RDAC_DOWN_TYPE("ctlr quiesced by admin request");
++ case RTPG_UNAVAIL_SERVICE_MODE:
++ return MSG_RDAC_DOWN_TYPE("ctlr is in service mode");
++ default:
++ return MSG_RDAC_DOWN_TYPE("ctlr is unavailable");
++ }
++}
++
+ extern int
+ libcheck_check (struct checker * c)
+ {
+ struct volume_access_inq inq;
+- int ret;
++ int ret, inqfail;
+
++ inqfail = 0;
+ memset(&inq, 0, sizeof(struct volume_access_inq));
+ if (0 != do_inq(c->fd, 0xC9, &inq, sizeof(struct volume_access_inq),
+ c->timeout)) {
+ ret = PATH_DOWN;
++ inqfail = 1;
+ goto done;
+ } else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x7f)) {
+ /* LUN not connected*/
+@@ -222,11 +276,27 @@ libcheck_check (struct checker * c)
+ goto done;
+ }
+
+- /* check if controller is reporting asymmetric access state of unavailable */
+- if ((inq.avtcvp & 0x10) &&
+- ((inq.asym_access_state_cur & 0x0F) == 0x3)) {
+- ret = PATH_DOWN;
+- goto done;
++ /* If TPGDE bit set, evaluate TPG information */
++ if ((inq.avtcvp & 0x10)) {
++ switch (inq.aas_cur & 0x0F) {
++ /* Never use the path if it reports unavailable */
++ case RTPG_UNAVAILABLE:
++ ret = PATH_DOWN;
++ goto done;
++ /*
++ * If both controllers report transitioning, it
++ * means mode select or STPG is being processed.
++ *
++ * If this controller alone is transitioning, it's
++ * booting and we shouldn't use it yet.
++ */
++ case RTPG_TRANSITIONING:
++ if ((inq.aas_alt & 0xF) != RTPG_TRANSITIONING) {
++ ret = PATH_DOWN;
++ goto done;
++ }
++ break;
++ }
+ }
+
+ /* If owner set or ioship mode is enabled return PATH_UP always */
+@@ -238,7 +308,8 @@ libcheck_check (struct checker * c)
+ done:
+ switch (ret) {
+ case PATH_DOWN:
+- MSG(c, MSG_RDAC_DOWN);
++ MSG(c, (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") :
++ checker_msg_string(&inq));
+ break;
+ case PATH_UP:
+ MSG(c, MSG_RDAC_UP);
+Index: multipath-tools-130222/libmultipath/discovery.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/discovery.c
++++ multipath-tools-130222/libmultipath/discovery.c
+@@ -1116,8 +1116,6 @@ pathinfo (struct path *pp, vector hwtabl
+ if (!strlen(pp->wwid))
+ get_uid(pp);
+ get_prio(pp);
+- } else {
+- pp->priority = PRIO_UNDEF;
+ }
+ }
+
diff --git a/0070-RHBZ-1036503-blacklist-td-devs.patch b/0070-RHBZ-1036503-blacklist-td-devs.patch
new file mode 100644
index 0000000..ffcae46
--- /dev/null
+++ b/0070-RHBZ-1036503-blacklist-td-devs.patch
@@ -0,0 +1,17 @@
+---
+ libmultipath/blacklist.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: multipath-tools-130222/libmultipath/blacklist.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/blacklist.c
++++ multipath-tools-130222/libmultipath/blacklist.c
+@@ -163,7 +163,7 @@ setup_default_blist (struct config * con
+ if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
+ return 1;
+
+- str = STRDUP("^hd[a-z]");
++ str = STRDUP("^(td|hd)[a-z]");
+ if (!str)
+ return 1;
+ if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT))
diff --git a/0071-RHBZ-1031546-strip-dev.patch b/0071-RHBZ-1031546-strip-dev.patch
new file mode 100644
index 0000000..64118c2
--- /dev/null
+++ b/0071-RHBZ-1031546-strip-dev.patch
@@ -0,0 +1,248 @@
+---
+ libmultipath/util.c | 22 ++++++++++++++++++++++
+ libmultipath/util.h | 1 +
+ multipath/main.c | 23 +----------------------
+ multipathd/cli_handlers.c | 18 ++++++++++++++++++
+ 4 files changed, 42 insertions(+), 22 deletions(-)
+
+Index: multipath-tools-130222/libmultipath/util.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/util.c
++++ multipath-tools-130222/libmultipath/util.c
+@@ -236,6 +236,28 @@ skip_proc:
+ return 0;
+ }
+
++/* This function returns a pointer inside of the supplied pathname string.
++ * If is_path_device is true, it may also modify the supplied string */
++char *convert_dev(char *name, int is_path_device)
++{
++ char *ptr;
++
++ if (!name)
++ return NULL;
++ if (is_path_device) {
++ ptr = strstr(name, "cciss/");
++ if (ptr) {
++ ptr += 5;
++ *ptr = '!';
++ }
++ }
++ if (!strncmp(name, "/dev/", 5) && strlen(name) > 5)
++ ptr = name + 5;
++ else
++ ptr = name;
++ return ptr;
++}
++
+ dev_t parse_devt(const char *dev_t)
+ {
+ int maj, min;
+Index: multipath-tools-130222/libmultipath/util.h
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/util.h
++++ multipath-tools-130222/libmultipath/util.h
+@@ -10,6 +10,7 @@ size_t strlcat(char *dst, const char *sr
+ void remove_trailing_chars(char *path, char c);
+ int devt2devname (char *, int, char *);
+ dev_t parse_devt(const char *dev_t);
++char *convert_dev(char *dev, int is_path_device);
+
+ #define safe_sprintf(var, format, args...) \
+ snprintf(var, sizeof(var), format, ##args) >= sizeof(var)
+Index: multipath-tools-130222/multipath/main.c
+===================================================================
+--- multipath-tools-130222.orig/multipath/main.c
++++ multipath-tools-130222/multipath/main.c
+@@ -254,16 +254,7 @@ configure (void)
+ vecs.pathvec = pathvec;
+ vecs.mpvec = curmp;
+
+- /*
+- * dev is "/dev/" . "sysfs block dev"
+- */
+- if (conf->dev) {
+- if (!strncmp(conf->dev, "/dev/", 5) &&
+- strlen(conf->dev) > 5)
+- dev = conf->dev + 5;
+- else
+- dev = conf->dev;
+- }
++ dev = convert_dev(conf->dev, (conf->dev_type == DEV_DEVNODE));
+
+ /*
+ * if we have a blacklisted device parameter, exit early
+@@ -427,16 +418,6 @@ 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[])
+ {
+@@ -577,8 +558,6 @@ 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;
+
+Index: multipath-tools-130222/multipathd/cli_handlers.c
+===================================================================
+--- multipath-tools-130222.orig/multipathd/cli_handlers.c
++++ multipath-tools-130222/multipathd/cli_handlers.c
+@@ -235,6 +235,7 @@ cli_list_map_topology (void * v, char **
+ struct vectors * vecs = (struct vectors *)data;
+ char * param = get_keyparam(v, MAP);
+
++ param = convert_dev(param, 0);
+ get_path_layout(vecs->pathvec, 0);
+ mpp = find_mp_by_str(vecs->mpvec, param);
+
+@@ -416,6 +417,7 @@ cli_add_path (void * v, char ** reply, i
+ struct path *pp;
+ int r;
+
++ param = convert_dev(param, 1);
+ condlog(2, "%s: add path (operator)", param);
+
+ if (filter_devnode(conf->blist_devnode, conf->elist_devnode,
+@@ -459,6 +461,7 @@ cli_del_path (void * v, char ** reply, i
+ char * param = get_keyparam(v, PATH);
+ struct path *pp;
+
++ param = convert_dev(param, 1);
+ condlog(2, "%s: remove path (operator)", param);
+ pp = find_path_by_dev(vecs->pathvec, param);
+ if (!pp) {
+@@ -478,6 +481,7 @@ cli_add_map (void * v, char ** reply, in
+ char *alias;
+ int rc;
+
++ param = convert_dev(param, 0);
+ condlog(2, "%s: add map (operator)", param);
+
+ if (filter_wwid(conf->blist_wwid, conf->elist_wwid, param) > 0) {
+@@ -518,6 +522,7 @@ cli_del_map (void * v, char ** reply, in
+ char *alias;
+ int rc;
+
++ param = convert_dev(param, 0);
+ condlog(2, "%s: remove map (operator)", param);
+ minor = dm_get_minor(param);
+ if (minor < 0) {
+@@ -549,6 +554,7 @@ cli_reload(void *v, char **reply, int *l
+ struct multipath *mpp;
+ int minor;
+
++ mapname = convert_dev(mapname, 0);
+ condlog(2, "%s: reload map (operator)", mapname);
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+@@ -591,6 +597,7 @@ cli_resize(void *v, char **reply, int *l
+ struct pathgroup *pgp;
+ struct path *pp;
+
++ mapname = convert_dev(mapname, 0);
+ condlog(2, "%s: resize map (operator)", mapname);
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+@@ -665,6 +672,7 @@ cli_restore_queueing(void *v, char **rep
+ struct multipath *mpp;
+ int minor;
+
++ mapname = convert_dev(mapname, 0);
+ condlog(2, "%s: restore map queueing (operator)", mapname);
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+@@ -716,6 +724,7 @@ cli_disable_queueing(void *v, char **rep
+ struct multipath *mpp;
+ int minor;
+
++ mapname = convert_dev(mapname, 0);
+ condlog(2, "%s: disable map queueing (operator)", mapname);
+ if (sscanf(mapname, "dm-%d", &minor) == 1)
+ mpp = find_mp_by_minor(vecs->mpvec, minor);
+@@ -753,6 +762,7 @@ cli_switch_group(void * v, char ** reply
+ char * mapname = get_keyparam(v, MAP);
+ int groupnum = atoi(get_keyparam(v, GROUP));
+
++ mapname = convert_dev(mapname, 0);
+ condlog(2, "%s: switch to path group #%i (operator)", mapname, groupnum);
+
+ return dm_switchgroup(mapname, groupnum);
+@@ -775,6 +785,7 @@ cli_suspend(void * v, char ** reply, int
+ char * param = get_keyparam(v, MAP);
+ int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param);
+
++ param = convert_dev(param, 0);
+ condlog(2, "%s: suspend (operator)", param);
+
+ if (!r) /* error */
+@@ -796,6 +807,7 @@ cli_resume(void * v, char ** reply, int
+ char * param = get_keyparam(v, MAP);
+ int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param);
+
++ param = convert_dev(param, 0);
+ condlog(2, "%s: resume (operator)", param);
+
+ if (!r) /* error */
+@@ -817,6 +829,7 @@ cli_reinstate(void * v, char ** reply, i
+ char * param = get_keyparam(v, PATH);
+ struct path * pp;
+
++ param = convert_dev(param, 1);
+ pp = find_path_by_dev(vecs->pathvec, param);
+
+ if (!pp)
+@@ -837,6 +850,7 @@ cli_reassign (void * v, char ** reply, i
+ {
+ char * param = get_keyparam(v, MAP);
+
++ param = convert_dev(param, 0);
+ condlog(3, "%s: reset devices (operator)", param);
+
+ dm_reassign(param);
+@@ -851,6 +865,7 @@ cli_fail(void * v, char ** reply, int *
+ struct path * pp;
+ int r;
+
++ param = convert_dev(param, 1);
+ pp = find_path_by_dev(vecs->pathvec, param);
+
+ if (!pp)
+@@ -962,6 +977,7 @@ cli_getprstatus (void * v, char ** reply
+ struct vectors * vecs = (struct vectors *)data;
+ char * param = get_keyparam(v, MAP);
+
++ param = convert_dev(param, 0);
+ get_path_layout(vecs->pathvec, 0);
+ mpp = find_mp_by_str(vecs->mpvec, param);
+
+@@ -991,6 +1007,7 @@ cli_setprstatus(void * v, char ** reply,
+ struct vectors * vecs = (struct vectors *)data;
+ char * param = get_keyparam(v, MAP);
+
++ param = convert_dev(param, 0);
+ get_path_layout(vecs->pathvec, 0);
+ mpp = find_mp_by_str(vecs->mpvec, param);
+
+@@ -1013,6 +1030,7 @@ cli_unsetprstatus(void * v, char ** repl
+ struct vectors * vecs = (struct vectors *)data;
+ char * param = get_keyparam(v, MAP);
+
++ param = convert_dev(param, 0);
+ get_path_layout(vecs->pathvec, 0);
+ mpp = find_mp_by_str(vecs->mpvec, param);
+
diff --git a/0072-RHBZ-1039199-check-loop-control.patch b/0072-RHBZ-1039199-check-loop-control.patch
new file mode 100644
index 0000000..21bd0c3
--- /dev/null
+++ b/0072-RHBZ-1039199-check-loop-control.patch
@@ -0,0 +1,46 @@
+---
+ kpartx/lopart.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+Index: multipath-tools-130222/kpartx/lopart.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/lopart.c
++++ multipath-tools-130222/kpartx/lopart.c
+@@ -32,6 +32,10 @@
+ #include "lopart.h"
+ #include "xstrncpy.h"
+
++#ifndef LOOP_CTL_GET_FREE
++#define LOOP_CTL_GET_FREE 0x4C82
++#endif
++
+ #if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) \
+ && !defined (__s390x__)
+ #define int2ptr(x) ((void *) ((int) x))
+@@ -140,14 +144,24 @@ find_unused_loop_device (void)
+
+ char dev[20];
+ char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
+- int i, j, fd, somedev = 0, someloop = 0, loop_known = 0;
++ int i, j, fd, first = 0, somedev = 0, someloop = 0, loop_known = 0;
+ struct stat statbuf;
+ struct loop_info loopinfo;
+ FILE *procdev;
+
++ if (stat("/dev/loop-control", &statbuf) == 0 &&
++ S_ISCHR(statbuf.st_mode)) {
++ fd = open("/dev/loop-control", O_RDWR);
++ if (fd >= 0) {
++ first = ioctl(fd, LOOP_CTL_GET_FREE);
++ close(fd);
++ }
++ if (first < 0)
++ first = 0;
++ }
+ for (j = 0; j < SIZE(loop_formats); j++) {
+
+- for(i = 0; i < 256; i++) {
++ for(i = first; i < 256; i++) {
+ sprintf(dev, loop_formats[j], i);
+
+ if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
diff --git a/0073-RH-update-build-flags.patch b/0073-RH-update-build-flags.patch
new file mode 100644
index 0000000..3ab72d0
--- /dev/null
+++ b/0073-RH-update-build-flags.patch
@@ -0,0 +1,33 @@
+---
+ Makefile.inc | 2 +-
+ libmultipath/checkers/rdac.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+Index: multipath-tools-130222/Makefile.inc
+===================================================================
+--- multipath-tools-130222.orig/Makefile.inc
++++ multipath-tools-130222/Makefile.inc
+@@ -39,7 +39,7 @@ GZIP = /bin/gzip -9 -c
+ INSTALL_PROGRAM = install
+
+ ifndef RPM_OPT_FLAGS
+- RPM_OPT_FLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
++ RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
+ endif
+
+ LDFLAGS += -Wl,-z,relro
+Index: multipath-tools-130222/libmultipath/checkers/rdac.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/checkers/rdac.c
++++ multipath-tools-130222/libmultipath/checkers/rdac.c
+@@ -308,8 +308,8 @@ libcheck_check (struct checker * c)
+ done:
+ switch (ret) {
+ case PATH_DOWN:
+- MSG(c, (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") :
+- checker_msg_string(&inq));
++ MSG(c, "%s", (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") :
++ checker_msg_string(&inq));
+ break;
+ case PATH_UP:
+ MSG(c, MSG_RDAC_UP);
diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec
index 259e76c..bb175bf 100644
--- a/device-mapper-multipath.spec
+++ b/device-mapper-multipath.spec
@@ -1,7 +1,7 @@
Summary: Tools to manage multipath devices using device-mapper
Name: device-mapper-multipath
Version: 0.4.9
-Release: 55%{?dist}
+Release: 56%{?dist}
License: GPL+
Group: System Environment/Base
URL: http://christophe.varoqui.free.fr/
@@ -68,6 +68,16 @@ Patch0057: 0057-UP-fix-tmo.patch
Patch0058: 0058-UP-fix-failback.patch
Patch0059: 0059-UP-flush-failure-queueing.patch
Patch0060: 0060-UP-uevent-loop-udev.patch
+Patch0061: 0061-RH-display-find-mpaths.patch
+Patch0062: 0062-RH-dont-free-vecs.patch
+Patch0063: 0063-RH-fix-warning.patch
+Patch0065: 0065-UPBZ-995538-fail-rdac-on-unavailable.patch
+Patch0066: 0066-UP-dos-4k-partition-fix.patch
+Patch0069: 0069-UPBZ-1033791-improve-rdac-checker.patch
+Patch0070: 0070-RHBZ-1036503-blacklist-td-devs.patch
+Patch0071: 0071-RHBZ-1031546-strip-dev.patch
+Patch0072: 0072-RHBZ-1039199-check-loop-control.patch
+Patch0073: 0073-RH-update-build-flags.patch
# runtime
Requires: %{name}-libs = %{version}-%{release}
@@ -180,6 +190,16 @@ kpartx manages partition creation and removal for device-mapper devices.
%patch0058 -p1
%patch0059 -p1
%patch0060 -p1
+%patch0061 -p1
+%patch0062 -p1
+%patch0063 -p1
+%patch0065 -p1
+%patch0066 -p1
+%patch0069 -p1
+%patch0070 -p1
+%patch0071 -p1
+%patch0072 -p1
+%patch0073 -p1
cp %{SOURCE1} .
%build
@@ -273,6 +293,32 @@ bin/systemctl --no-reload enable multipathd.service >/dev/null 2>&1 ||:
%{_mandir}/man8/kpartx.8.gz
%changelog
+* Mon Jan 13 2014 Benjamin Marzinski <bmarzins at redhat.com> 0.4.9-56
+- Add 0061-RH-display-find-mpaths.patch
+ * display the find_multipaths value in show config
+- Add 0062-RH-dont-free-vecs.patch
+ * don't free the vecs structure on shutdown. It's more pain than
+ it's worth.
+- Add 0063-RH-fix-warning.patch
+ * Fix complier warning
+- Add 0065-UPBZ-995538-fail-rdac-on-unavailable.patch
+ * make rdac checker always mark paths with asymmetric access state of
+ unavailable as down
+- Add 0066-UP-dos-4k-partition-fix.patch
+ * Make kpartx correctly handle 4K sector size devices with dos partitions.
+- Add 0069-UPBZ-1033791-improve-rdac-checker.patch
+ * Use RTPG data in RDAC checker
+- Add 0070-RHBZ-1036503-blacklist-td-devs.patch
+- Add 0071-RHBZ-1031546-strip-dev.patch
+ * make multipathd interactive commands able to handle /dev/<devnode>
+ instead of just <devnode>
+- Add 0072-RHBZ-1039199-check-loop-control.patch
+ * Make kpartx use LOOP_CTL_GET_FREE and loop-control to find a free
+ loop device. This will autoload the loop module.
+- Add 0073-RH-update-build-flags.patch
+ * fix print call to work with -Werror=format-security compile flag
+- Resolves: bz #1039136
+
* Thu Jul 25 2013 Benjamin Marzinski <bmarzins at redhat.com> 0.4.9-55
- Modify 0015-RH-fix-output-buffer.patch
* Fix memory leak
More information about the scm-commits
mailing list