device-mapper-multipath/0167-RHBZ-1335176-fix-show-cmds.patch
Benjamin Marzinski 906e1e1128 device-mapper-multipath-0.4.9-83
Modify 0135-RHBZ-1299600-path-dev-uevents.patch
  * trigger uevents when adding wwids for existing devices during startup
Refresh 0136-RHBZ-1304687-wait-for-map-add.patch
Refresh 0150-RHBZ-1253913-fix-startup-msg.patch
Modify 0159-UPBZ-1255885-udev-waits.patch
  * fix bug in failure path
Add 0160-RH-udev-flags.patch
Add 0161-RHBZ-1311659-no-kpartx.patch
  * skip_kpartx option disables kpartx running on multipath devices
Add 0162-RHBZ-1333331-huawei-config.patch
  * Add default config for Huawei XSG1 array
Add 0163-UPBZ-1333492-resize-map.patch
  * restore old size if resize fails
Add 0164-RHBZ-1311463-dos-part-rollover.patch
  * fix incorrect partition size due to 4k device size rollover
Add 0165-UPBZ-1341748-MSA-2040-conf.patch
  * Add default config for MSA 2040 array
Add 0166-RHBZ-1323429-dont-allow-new-wwid.patch
  * don't allow path wwid to change while it is in use
Add 0167-RHBZ-1335176-fix-show-cmds.patch
  * and new show multipath format wildcard, 'f' to sho number of failures.
    This will hopefully be useful for tracking what happens to multipath
    devices for bz #1335176
Add 0168-RHBZ-1347769-shared-lock.patch
  * make multipath lock the path devices with a shared lock
Add 0169-UPBZ-1353357-json-output.patch
  * add mulitpathd json output command
Add 0170-UPBZ-1352925-fix-typo.patch
Add 0171-UPBZ-1356651-allow-zero-size.patch
  * Allow zero-sized paths to be added to a multipath device
Add 0172-RHBZ-1350931-no-active-add.patch
  * Allow paths to be added to a new map if no active paths exist. Also
    fixes 1351430
2016-07-22 15:20:02 -05:00

139 lines
4.9 KiB
Diff

---
libmultipath/print.c | 7 +++++++
libmultipath/structs.h | 1 +
libmultipath/structs_vec.c | 24 ++++++++++++++----------
multipathd/cli_handlers.c | 11 ++++++++++-
multipathd/main.c | 2 ++
5 files changed, 34 insertions(+), 11 deletions(-)
Index: multipath-tools-130222/libmultipath/print.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/print.c
+++ multipath-tools-130222/libmultipath/print.c
@@ -248,6 +248,12 @@ snprint_q_timeouts (char * buff, size_t
}
static int
+snprint_map_failures (char * buff, size_t len, struct multipath * mpp)
+{
+ return snprint_uint(buff, len, mpp->stat_map_failures);
+}
+
+static int
snprint_multipath_uuid (char * buff, size_t len, struct multipath * mpp)
{
return snprint_str(buff, len, mpp->wwid);
@@ -546,6 +552,7 @@ struct multipath_data mpd[] = {
{'t', "dm-st", 0, snprint_dm_map_state},
{'S', "size", 0, snprint_multipath_size},
{'f', "features", 0, snprint_features},
+ {'x', "failures", 0, snprint_map_failures},
{'h', "hwhandler", 0, snprint_hwhandler},
{'A', "action", 0, snprint_action},
{'0', "path_faults", 0, snprint_path_faults},
Index: multipath-tools-130222/libmultipath/structs.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/structs.h
+++ multipath-tools-130222/libmultipath/structs.h
@@ -270,6 +270,7 @@ struct multipath {
unsigned int stat_map_loads;
unsigned int stat_total_queueing_time;
unsigned int stat_queueing_timeouts;
+ unsigned int stat_map_failures;
/* checkers shared data */
void * mpcontext;
Index: multipath-tools-130222/libmultipath/structs_vec.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/structs_vec.c
+++ multipath-tools-130222/libmultipath/structs_vec.c
@@ -579,16 +579,20 @@ int update_multipath (struct vectors *ve
*/
void update_queue_mode_del_path(struct multipath *mpp)
{
- if (--mpp->nr_active == 0 && mpp->no_path_retry > 0) {
- /*
- * Enter retry mode.
- * meaning of +1: retry_tick may be decremented in
- * checkerloop before starting retry.
- */
- mpp->stat_queueing_timeouts++;
- mpp->retry_tick = mpp->no_path_retry * conf->checkint + 1;
- condlog(1, "%s: Entering recovery mode: max_retries=%d",
- mpp->alias, mpp->no_path_retry);
+ if (--mpp->nr_active == 0) {
+ if (mpp->no_path_retry > 0) {
+ /*
+ * Enter retry mode.
+ * meaning of +1: retry_tick may be decremented in
+ * checkerloop before starting retry.
+ */
+ mpp->stat_queueing_timeouts++;
+ mpp->retry_tick = mpp->no_path_retry *
+ conf->checkint + 1;
+ condlog(1, "%s: Entering recovery mode: max_retries=%d",
+ mpp->alias, mpp->no_path_retry);
+ } else if (mpp->no_path_retry != NO_PATH_RETRY_QUEUE)
+ mpp->stat_map_failures++;
}
condlog(2, "%s: remaining active paths: %d", mpp->alias, mpp->nr_active);
}
Index: multipath-tools-130222/multipathd/cli_handlers.c
===================================================================
--- multipath-tools-130222.orig/multipathd/cli_handlers.c
+++ multipath-tools-130222/multipathd/cli_handlers.c
@@ -319,9 +319,14 @@ show_maps (char ** r, int *len, struct v
c += snprint_multipath_header(c, reply + maxlen - c,
style);
- vector_foreach_slot(vecs->mpvec, mpp, i)
+ vector_foreach_slot(vecs->mpvec, mpp, i) {
+ if (update_multipath(vecs, mpp->alias, 0)) {
+ i--;
+ continue;
+ }
c += snprint_multipath(c, reply + maxlen - c,
style, mpp, pretty);
+ }
again = ((c - reply) == (maxlen - 1));
@@ -742,6 +747,8 @@ cli_disable_queueing(void *v, char **rep
return 1;
}
+ if (mpp->nr_active == 0)
+ mpp->stat_map_failures++;
mpp->retry_tick = 0;
dm_queue_if_no_path(mpp->alias, 0);
return 0;
@@ -756,6 +763,8 @@ cli_disable_all_queueing(void *v, char *
condlog(2, "disable queueing (operator)");
vector_foreach_slot(vecs->mpvec, mpp, i) {
+ if (mpp->nr_active == 0)
+ mpp->stat_map_failures++;
mpp->retry_tick = 0;
dm_queue_if_no_path(mpp->alias, 0);
}
Index: multipath-tools-130222/multipathd/main.c
===================================================================
--- multipath-tools-130222.orig/multipathd/main.c
+++ multipath-tools-130222/multipathd/main.c
@@ -716,6 +716,7 @@ ev_remove_path (struct path *pp, struct
mpp->retry_tick = 0;
mpp->no_path_retry = NO_PATH_RETRY_FAIL;
mpp->flush_on_last_del = FLUSH_IN_PROGRESS;
+ mpp->stat_map_failures++;
dm_queue_if_no_path(mpp->alias, 0);
}
if (!flush_map(mpp, vecs, 1)) {
@@ -1184,6 +1185,7 @@ retry_count_tick(vector mpvec)
mpp->stat_total_queueing_time++;
condlog(4, "%s: Retrying.. No active path", mpp->alias);
if(--mpp->retry_tick == 0) {
+ mpp->stat_map_failures++;
dm_queue_if_no_path(mpp->alias, 0);
condlog(2, "%s: Disable queueing", mpp->alias);
}