From 5f9fee541fbf68bcbdd0dbba42e651f9eea1b06e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 12 2016 16:45:21 +0000 Subject: import device-mapper-multipath-0.4.9-85.el7_2.2 --- diff --git a/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch b/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch deleted file mode 100644 index 742348f..0000000 --- a/SOURCES/0134-UPBZ-1328515-dont-fail-discovery.patch +++ /dev/null @@ -1,236 +0,0 @@ ---- - libmpathpersist/mpath_persist.c | 14 ++++++------ - libmultipath/discovery.c | 46 ++++++++++++++++++++-------------------- - libmultipath/discovery.h | 4 +++ - multipath/main.c | 2 - - multipathd/main.c | 6 +++-- - 5 files changed, 39 insertions(+), 33 deletions(-) - -Index: multipath-bz1328515/libmpathpersist/mpath_persist.c -=================================================================== ---- multipath-bz1328515.orig/libmpathpersist/mpath_persist.c -+++ multipath-bz1328515/libmpathpersist/mpath_persist.c -@@ -178,7 +178,7 @@ int mpath_persistent_reserve_in (int fd, - goto out; - } - -- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { -+ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { - ret = MPATH_PR_DMMP_ERROR; - goto out1; - } -@@ -262,13 +262,13 @@ int mpath_persistent_reserve_out ( int f - curmp = vector_alloc (); - pathvec = vector_alloc (); - -- if (!curmp || !pathvec){ -- condlog (0, "%s: vector allocation failed.", alias); -- ret = MPATH_PR_DMMP_ERROR; -- goto out; -- } -+ if (!curmp || !pathvec){ -+ condlog (0, "%s: vector allocation failed.", alias); -+ ret = MPATH_PR_DMMP_ERROR; -+ goto out; -+ } - -- if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER)) { -+ if (path_discovery(pathvec, conf, DI_SYSFS | DI_CHECKER) < 0) { - ret = MPATH_PR_DMMP_ERROR; - goto out1; - } -Index: multipath-bz1328515/libmultipath/discovery.c -=================================================================== ---- multipath-bz1328515.orig/libmultipath/discovery.c -+++ multipath-bz1328515/libmultipath/discovery.c -@@ -32,7 +32,7 @@ int - store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice, - int flag, struct path **pp_ptr) - { -- int err = 1; -+ int err = PATHINFO_FAILED; - struct path * pp; - const char * devname; - -@@ -41,12 +41,12 @@ store_pathinfo (vector pathvec, vector h - - devname = udev_device_get_sysname(udevice); - if (!devname) -- return 1; -+ return PATHINFO_FAILED; - - pp = alloc_path(); - - if (!pp) -- return 1; -+ return PATHINFO_FAILED; - - if(safe_sprintf(pp->dev, "%s", devname)) { - condlog(0, "pp->dev too small"); -@@ -80,19 +80,16 @@ path_discover (vector pathvec, struct co - - devname = udev_device_get_sysname(udevice); - if (!devname) -- return 0; -+ return PATHINFO_FAILED; - - if (filter_devnode(conf->blist_devnode, conf->elist_devnode, - (char *)devname) > 0) -- return 0; -+ return PATHINFO_SKIPPED; - - pp = find_path_by_dev(pathvec, (char *)devname); - if (!pp) { -- if (store_pathinfo(pathvec, conf->hwtable, -- udevice, flag, NULL) != 1) -- return 0; -- else -- return 1; -+ return store_pathinfo(pathvec, conf->hwtable, -+ udevice, flag, NULL); - } - return pathinfo(pp, conf->hwtable, flag); - } -@@ -104,11 +101,11 @@ path_discovery (vector pathvec, struct c - struct udev_list_entry *entry; - struct udev_device *udevice; - const char *devpath; -- int r = 0; -+ int num_paths = 0, total_paths = 0; - - udev_iter = udev_enumerate_new(conf->udev); - if (!udev_iter) -- return 1; -+ return -ENOMEM; - - udev_enumerate_add_match_subsystem(udev_iter, "block"); - udev_enumerate_scan_devices(udev_iter); -@@ -121,17 +118,20 @@ path_discovery (vector pathvec, struct c - udevice = udev_device_new_from_syspath(conf->udev, devpath); - if (!udevice) { - condlog(4, "%s: no udev information", devpath); -- r++; - continue; - } - devtype = udev_device_get_devtype(udevice); -- if(devtype && !strncmp(devtype, "disk", 4)) -- r += path_discover(pathvec, conf, udevice, flag); -+ if(devtype && !strncmp(devtype, "disk", 4)) { -+ total_paths++; -+ if (path_discover(pathvec, conf, -+ udevice, flag) == PATHINFO_OK) -+ num_paths++; -+ } - udev_device_unref(udevice); - } - udev_enumerate_unref(udev_iter); -- condlog(4, "Discovery status %d", r); -- return r; -+ condlog(4, "Discovered %d/%d paths", num_paths, total_paths); -+ return (total_paths - num_paths); - } - - #define declare_sysfs_get_str(fname) \ -@@ -1021,7 +1021,7 @@ get_state (struct path * pp, int daemon) - - if (!checker_selected(c)) { - if (daemon) { -- if (pathinfo(pp, conf->hwtable, DI_SYSFS) != 0) { -+ if (pathinfo(pp, conf->hwtable, DI_SYSFS) != PATHINFO_OK) { - condlog(3, "%s: couldn't get sysfs pathinfo", - pp->dev); - return PATH_UNCHECKED; -@@ -1140,7 +1140,7 @@ pathinfo (struct path *pp, vector hwtabl - int path_state; - - if (!pp) -- return 1; -+ return PATHINFO_FAILED; - - condlog(3, "%s: mask = 0x%x", pp->dev, mask); - -@@ -1148,12 +1148,12 @@ pathinfo (struct path *pp, vector hwtabl - * fetch info available in sysfs - */ - if (mask & DI_SYSFS && sysfs_pathinfo(pp)) -- return 1; -+ return PATHINFO_FAILED; - - if (mask & DI_BLACKLIST && mask & DI_SYSFS) { - if (filter_device(conf->blist_device, conf->elist_device, - pp->vendor_id, pp->product_id) > 0) { -- return 2; -+ return PATHINFO_SKIPPED; - } - } - -@@ -1199,7 +1199,7 @@ pathinfo (struct path *pp, vector hwtabl - if (mask & DI_BLACKLIST && mask & DI_WWID) { - if (filter_wwid(conf->blist_wwid, conf->elist_wwid, - pp->wwid) > 0) { -- return 2; -+ return PATHINFO_SKIPPED; - } - } - -@@ -1213,7 +1213,7 @@ pathinfo (struct path *pp, vector hwtabl - } - } - -- return 0; -+ return PATHINFO_OK; - - blank: - /* -Index: multipath-bz1328515/libmultipath/discovery.h -=================================================================== ---- multipath-bz1328515.orig/libmultipath/discovery.h -+++ multipath-bz1328515/libmultipath/discovery.h -@@ -24,6 +24,10 @@ - #define SCSI_COMMAND_TERMINATED 0x22 - #define SG_ERR_DRIVER_SENSE 0x08 - -+#define PATHINFO_OK 0 -+#define PATHINFO_FAILED 1 -+#define PATHINFO_SKIPPED 2 -+ - struct config; - - int sysfs_get_dev (struct udev_device *udev, char * buff, size_t len); -Index: multipath-bz1328515/multipath/main.c -=================================================================== ---- multipath-bz1328515.orig/multipath/main.c -+++ multipath-bz1328515/multipath/main.c -@@ -344,7 +344,7 @@ configure (void) - /* maximum info */ - di_flag = DI_ALL; - -- if (path_discovery(pathvec, conf, di_flag)) -+ if (path_discovery(pathvec, conf, di_flag) < 0) - goto out; - - if (conf->verbosity > 2) -Index: multipath-bz1328515/multipathd/main.c -=================================================================== ---- multipath-bz1328515.orig/multipathd/main.c -+++ multipath-bz1328515/multipathd/main.c -@@ -1481,7 +1481,7 @@ configure (struct vectors * vecs, int st - struct multipath * mpp; - struct path * pp; - vector mpvec; -- int i; -+ int i, ret; - - if (!vecs->pathvec && !(vecs->pathvec = vector_alloc())) - return 1; -@@ -1495,7 +1495,9 @@ configure (struct vectors * vecs, int st - /* - * probe for current path (from sysfs) and map (from dm) sets - */ -- path_discovery(vecs->pathvec, conf, DI_ALL); -+ ret = path_discovery(vecs->pathvec, conf, DI_ALL); -+ if (ret < 0) -+ return 1; - - vector_foreach_slot (vecs->pathvec, pp, i){ - if (filter_path(conf, pp) > 0){ diff --git a/SOURCES/0135-RHBZ-1330480-kpartx-sync.patch b/SOURCES/0135-RHBZ-1330480-kpartx-sync.patch deleted file mode 100644 index ba95135..0000000 --- a/SOURCES/0135-RHBZ-1330480-kpartx-sync.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- - kpartx/kpartx.c | 10 +++++++--- - multipath/multipath.rules | 2 +- - 2 files changed, 8 insertions(+), 4 deletions(-) - -Index: multipath-bz1330480/kpartx/kpartx.c -=================================================================== ---- multipath-bz1330480.orig/kpartx/kpartx.c -+++ multipath-bz1330480/kpartx/kpartx.c -@@ -57,7 +57,7 @@ struct pt { - } pts[MAXTYPES]; - - int ptct = 0; --int udev_sync = 0; -+int udev_sync = 1; - - static void - addpts(char *t, ptreader f) -@@ -85,7 +85,7 @@ initpts(void) - addpts("ps3", read_ps3_pt); - } - --static char short_opts[] = "rladfgvp:t:su"; -+static char short_opts[] = "rladfgvp:t:snu"; - - /* Used in gpt.c */ - int force_gpt=0; -@@ -104,7 +104,8 @@ usage(void) { - printf("\t-g force GUID partition table (GPT)\n"); - printf("\t-f force devmap create\n"); - printf("\t-v verbose\n"); -- printf("\t-s sync mode. Don't return until the partitions are created\n"); -+ printf("\t-n nosync mode. Return before the partitions are created\n"); -+ printf("\t-s sync mode. Don't return until the partitions are created. Default.\n"); - return 1; - } - -@@ -270,6 +271,9 @@ main(int argc, char **argv){ - case 's': - udev_sync = 1; - break; -+ case 'n': -+ udev_sync = 0; -+ break; - case 'u': - what = UPDATE; - break; -Index: multipath-bz1330480/multipath/multipath.rules -=================================================================== ---- multipath-bz1330480.orig/multipath/multipath.rules -+++ multipath-bz1330480/multipath/multipath.rules -@@ -48,6 +48,6 @@ ENV{DM_ACTIVATION}=="1", ENV{DM_MULTIPAT - ENV{DM_SUSPENDED}=="1", GOTO="end_mpath" - ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" - ENV{DM_ACTIVATION}!="1", ENV{DM_MULTIPATH_NEED_KPARTX}!="1", GOTO="end_mpath" --RUN+="$env{MPATH_SBIN_PATH}/kpartx -a $tempnode", \ -+RUN+="$env{MPATH_SBIN_PATH}/kpartx -an $tempnode", \ - ENV{DM_MULTIPATH_NEED_KPARTX}="" - LABEL="end_mpath" diff --git a/SPECS/device-mapper-multipath.spec b/SPECS/device-mapper-multipath.spec index eaedd89..74b7ea1 100644 --- a/SPECS/device-mapper-multipath.spec +++ b/SPECS/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: 85%{?dist}.4 +Release: 85%{?dist}.2 License: GPL+ Group: System Environment/Base URL: http://christophe.varoqui.free.fr/ @@ -141,8 +141,6 @@ Patch0130: 0130-RHBZ-1259523-host_name_len.patch Patch0131: 0131-UPBZ-1259831-lock-retry.patch Patch0132: 0132-RHBZ-1296979-fix-define.patch Patch0133: 0133-RHBZ-1321019-wait-for-map-add.patch -Patch0134: 0134-UPBZ-1328515-dont-fail-discovery.patch -Patch0135: 0135-RHBZ-1330480-kpartx-sync.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -328,8 +326,6 @@ kpartx manages partition creation and removal for device-mapper devices. %patch0131 -p1 %patch0132 -p1 %patch0133 -p1 -%patch0134 -p1 -%patch0135 -p1 cp %{SOURCE1} . %build @@ -424,16 +420,6 @@ bin/systemctl --no-reload enable multipathd.service >/dev/null 2>&1 ||: %{_mandir}/man8/kpartx.8.gz %changelog -* Wed Apr 27 2016 Benjamin Marzinski 0.4.9-85.4 -- Add 0135-RHBZ-1330480-kpartx-sync.patch - * default to using udev sync mode -- Resolves: bz #1330480 - -* Tue Apr 19 2016 Benjamin Marzinski 0.4.9-85.3 -- Add 0134-UPBZ-1328515-dont-fail-discovery.patch - * don't fail discovery because individual paths failed. -- Resolves: bz #1328515 - * Mon Mar 28 2016 Benjamin Marzinski 0.4.9-85.2 - Add 0133-RHBZ-1321019-wait-for-map-add.patch * wait for the device to finish being added before reloading it.