device-mapper-multipath/0154-UPBZ-1291406-disable-reinstate.patch

155 lines
4.5 KiB
Diff
Raw Normal View History

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
2016-04-22 02:27:49 +00:00
---
libmultipath/propsel.c | 20 ++++++++++++++++----
libmultipath/structs.h | 1 +
multipathd/main.c | 37 ++++++++++++++++++++++++++-----------
3 files changed, 43 insertions(+), 15 deletions(-)
Index: multipath-tools-130222/libmultipath/propsel.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/propsel.c
+++ multipath-tools-130222/libmultipath/propsel.c
@@ -398,9 +398,11 @@ detect_prio(struct path * pp)
{
int ret;
struct prio *p = &pp->prio;
+ int tpgs = 0;
- if (get_target_port_group_support(pp->fd) <= 0)
+ if ((tpgs = get_target_port_group_support(pp->fd)) <= 0)
return;
+ pp->tpgs = tpgs;
ret = get_target_port_group(pp->fd, NULL);
if (ret < 0)
return;
@@ -432,7 +434,7 @@ select_prio (struct path * pp)
pp->dev, prio_name(p));
condlog(3, "%s: prio args = %s (LUN setting)",
pp->dev, prio_args(p));
- return 0;
+ goto out;
}
if (pp->hwe && pp->hwe->prio_name) {
@@ -441,7 +443,7 @@ select_prio (struct path * pp)
pp->dev, pp->hwe->prio_name);
condlog(3, "%s: prio args = %s (controller setting)",
pp->dev, pp->hwe->prio_args);
- return 0;
+ goto out;
}
if (conf->prio_name) {
prio_get(p, conf->prio_name, conf->prio_args);
@@ -449,13 +451,23 @@ select_prio (struct path * pp)
pp->dev, conf->prio_name);
condlog(3, "%s: prio args = %s (config file default)",
pp->dev, conf->prio_args);
- return 0;
+ goto out;
}
prio_get(p, DEFAULT_PRIO, DEFAULT_PRIO_ARGS);
condlog(3, "%s: prio = %s (internal default)",
pp->dev, DEFAULT_PRIO);
condlog(3, "%s: prio args = %s (internal default)",
pp->dev, DEFAULT_PRIO_ARGS);
+out:
+ /*
+ * fetch tpgs mode for alua
+ */
+ if (!strncmp(prio_name(p), PRIO_ALUA, PRIO_NAME_LEN)) {
+ int tpgs = 0;
+ if (!pp->tpgs &&
+ (tpgs = get_target_port_group_support(pp->fd)) >= 0)
+ pp->tpgs = tpgs;
+ }
return 0;
}
Index: multipath-tools-130222/libmultipath/structs.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/structs.h
+++ multipath-tools-130222/libmultipath/structs.h
@@ -193,6 +193,7 @@ struct path {
int detect_prio;
int watch_checks;
int wait_checks;
+ int tpgs;
char * uid_attribute;
struct prio prio;
char * prio_args;
Index: multipath-tools-130222/multipathd/main.c
===================================================================
--- multipath-tools-130222.orig/multipathd/main.c
+++ multipath-tools-130222/multipathd/main.c
@@ -19,6 +19,7 @@
#include <libudev.h>
#include <semaphore.h>
#include <mpath_persist.h>
+#include "prioritizers/alua_rtpg.h"
/*
* libcheckers
@@ -1235,6 +1236,7 @@ check_path (struct vectors * vecs, struc
int newstate;
int new_path_up = 0;
int chkr_new_path_up = 0;
+ int disable_reinstate = 0;
int oldchkrstate = pp->chkrstate;
if (!pp->mpp && (pp->missing_udev_info != INFO_MISSING ||
@@ -1299,6 +1301,16 @@ check_path (struct vectors * vecs, struc
pp->wait_checks = 0;
}
+ /*
+ * don't reinstate failed path, if its in stand-by
+ * and if target supports only implicit tpgs mode.
+ * this will prevent unnecessary i/o by dm on stand-by
+ * paths if there are no other active paths in map.
+ */
+ disable_reinstate = (newstate == PATH_GHOST &&
+ pp->mpp->nr_active == 0 &&
+ pp->tpgs == TPGS_IMPLICIT) ? 1 : 0;
+
pp->chkrstate = newstate;
if (newstate != pp->state) {
int oldstate = pp->state;
@@ -1354,15 +1366,17 @@ check_path (struct vectors * vecs, struc
/*
* reinstate this path
*/
- if (oldstate != PATH_UP &&
- oldstate != PATH_GHOST) {
- if (pp->mpp->delay_watch_checks > 0)
- pp->watch_checks = pp->mpp->delay_watch_checks;
- reinstate_path(pp, 1);
- } else {
- if (pp->watch_checks > 0)
- pp->watch_checks--;
- reinstate_path(pp, 0);
+ if (!disable_reinstate) {
+ if (oldstate != PATH_UP &&
+ oldstate != PATH_GHOST) {
+ if (pp->mpp->delay_watch_checks > 0)
+ pp->watch_checks = pp->mpp->delay_watch_checks;
+ reinstate_path(pp, 1);
+ } else {
+ if (pp->watch_checks > 0)
+ pp->watch_checks--;
+ reinstate_path(pp, 0);
+ }
}
new_path_up = 1;
@@ -1377,8 +1391,9 @@ check_path (struct vectors * vecs, struc
enable_group(pp);
}
else if (newstate == PATH_UP || newstate == PATH_GHOST) {
- if (pp->dmstate == PSTATE_FAILED ||
- pp->dmstate == PSTATE_UNDEF) {
+ if ((pp->dmstate == PSTATE_FAILED ||
+ pp->dmstate == PSTATE_UNDEF) &&
+ !disable_reinstate) {
/* Clear IO errors */
reinstate_path(pp, 0);
} else {