summaryrefslogtreecommitdiffstats
path: root/0156-UPBZ-1313324-dont-fail-discovery.patch
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2016-04-21 21:27:49 -0500
committerBenjamin Marzinski <bmarzins@redhat.com>2016-04-21 21:27:49 -0500
commit6738b34a0b0aabf1bc8c15d540bafa29ca99c58f (patch)
treecf5a37898b4bacc7fefcc08db661338bfdb9ffec /0156-UPBZ-1313324-dont-fail-discovery.patch
parentfef216999bec3651f01b934a3ece5a69f6eca598 (diff)
downloaddevice-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.tar.gz
device-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.tar.xz
device-mapper-multipath-6738b34a0b0aabf1bc8c15d540bafa29ca99c58f.zip
device-mapper-multipath-0.4.9-82
- Modify 0005-RH-add-mpathconf.patch * changed warning message - Modify 0102-RHBZ-1160478-mpathconf-template.patch * updated man page - Modify 0104-RHBZ-631009-deferred-remove.patch * refactor code and minor fix - Refresh 0107-RHBZ-1169935-no-new-devs.patch - Refresh 0112-RHBZ-1194917-add-config_dir-option.patch - Refresh 0126-RHBZ-1211383-alias-collision.patch - Add 0133-RHBZ-1296979-fix-define.patch * look for the correct libudev function to set define - Add 0134-RHBZ-1241528-check-mpath-prefix.patch * only touch devices with a "mpath-" dm uuid prefix - Add 0135-RHBZ-1299600-path-dev-uevents.patch * trigger path uevent the first time a path is claimed by multipath - Add 0136-RHBZ-1304687-wait-for-map-add.patch * wait for the device to finish being added before reloading it. - Add 0137-RHBZ-1280524-clear-chkr-msg.patch - Add 0138-RHBZ-1288660-fix-mpathconf-allow.patch * don't remove existing lines from blacklist_exceptions section - Add 0139-RHBZ-1273173-queue-no-daemon-doc.patch - Add 0140-RHBZ-1299647-fix-help.patch - Add 0141-RHBZ-1303953-mpathpersist-typo.patch - Add 0142-RHBZ-1283750-kpartx-fix.patch * only remove devices if their uuid says that they are the correct partition device - Add 0143-RHBZ-1299648-kpartx-sync.patch * default to using udev sync mode - Add 0144-RHBZ-1299652-alua-pref-arg.patch * allow "exclusive_pref_bit" argument to alua prioritizer - Add 0145-UP-resize-help-msg.patch - Add 0146-UPBZ-1299651-raw-output.patch * allow raw format mutipathd show commands, that remove headers and padding - Add 0147-RHBZ-1272620-fail-rm-msg.patch - Add 0148-RHBZ-1292599-verify-before-remove.patch * verify that all partitions are unused before attempting to remove a device - Add 0149-RHBZ-1292599-restore-removed-parts.patch * don't disable kpartx when restoring the first path of a device. - Add 0150-RHBZ-1253913-fix-startup-msg.patch * wait for multipathd daemon to write pidfile before returning - Add 0151-RHBZ-1297456-weighted-fix.patch * add wwn keyword to weighted prioritizer for persistent naming - Add 0152-RHBZ-1269293-fix-blk-unit-file.patch * use "Wants" instead of "Requires" - Add 0153-RH-fix-i686-size-bug.patch * use 64-bit keycodes for multipathd client commands - Add 0154-UPBZ-1291406-disable-reinstate.patch * don't automatically reinstate ghost paths for implicit alua devices - Add 0155-UPBZ-1300415-PURE-config.patch * Add default config for PURE FlashArray - Add 0156-UPBZ-1313324-dont-fail-discovery.patch * don't fail discovery because individual paths failed. - Add 0157-RHBZ-1319853-multipath-c-error-msg.patch * better error reporting for multipath -c - Add 0158-RHBZ-1318581-timestamp-doc-fix.patch * add documentation for -T - Add 0159-UPBZ-1255885-udev-waits.patch * make multipath and kpartx wait after for udev after each command
Diffstat (limited to '0156-UPBZ-1313324-dont-fail-discovery.patch')
-rw-r--r--0156-UPBZ-1313324-dont-fail-discovery.patch236
1 files changed, 236 insertions, 0 deletions
diff --git a/0156-UPBZ-1313324-dont-fail-discovery.patch b/0156-UPBZ-1313324-dont-fail-discovery.patch
new file mode 100644
index 0000000..36262f7
--- /dev/null
+++ b/0156-UPBZ-1313324-dont-fail-discovery.patch
@@ -0,0 +1,236 @@
+---
+ 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-tools-130222/libmpathpersist/mpath_persist.c
+===================================================================
+--- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c
++++ multipath-tools-130222/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-tools-130222/libmultipath/discovery.c
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/discovery.c
++++ multipath-tools-130222/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-tools-130222/libmultipath/discovery.h
+===================================================================
+--- multipath-tools-130222.orig/libmultipath/discovery.h
++++ multipath-tools-130222/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-tools-130222/multipath/main.c
+===================================================================
+--- multipath-tools-130222.orig/multipath/main.c
++++ multipath-tools-130222/multipath/main.c
+@@ -343,7 +343,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-tools-130222/multipathd/main.c
+===================================================================
+--- multipath-tools-130222.orig/multipathd/main.c
++++ multipath-tools-130222/multipathd/main.c
+@@ -1502,7 +1502,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;
+@@ -1516,7 +1516,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){