2 libmultipath/config.c | 1 +
3 libmultipath/config.h | 1 +
4 libmultipath/dict.c | 33 +++++++++++++++++++++++++++++++++
5 libmultipath/discovery.c | 8 ++++++--
6 multipath.conf.annotated | 10 ++++++++++
7 multipath/multipath.conf.5 | 9 +++++++++
8 6 files changed, 60 insertions(+), 2 deletions(-)
10 Index: multipath-tools-130222/libmultipath/config.c
11 ===================================================================
12 --- multipath-tools-130222.orig/libmultipath/config.c
13 +++ multipath-tools-130222/libmultipath/config.c
14 @@ -556,6 +556,7 @@ load_config (char * file, struct udev *u
15 conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER;
16 conf->detect_prio = DEFAULT_DETECT_PRIO;
17 conf->hw_strmatch = 0;
18 + conf->force_sync = 0;
21 * preload default hwtable
22 Index: multipath-tools-130222/libmultipath/config.h
23 ===================================================================
24 --- multipath-tools-130222.orig/libmultipath/config.h
25 +++ multipath-tools-130222/libmultipath/config.h
26 @@ -115,6 +115,7 @@ struct config {
31 unsigned int version[3];
34 Index: multipath-tools-130222/libmultipath/dict.c
35 ===================================================================
36 --- multipath-tools-130222.orig/libmultipath/dict.c
37 +++ multipath-tools-130222/libmultipath/dict.c
38 @@ -712,6 +712,29 @@ def_hw_strmatch_handler(vector strvec)
43 +def_force_sync_handler(vector strvec)
47 + buff = set_value(strvec);
52 + if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
53 + (strlen(buff) == 1 && !strcmp(buff, "0")))
54 + conf->force_sync = 0;
55 + else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
56 + (strlen(buff) == 1 && !strcmp(buff, "1")))
57 + conf->force_sync = 1;
59 + conf->force_sync = 0;
66 * blacklist block handlers
68 @@ -2822,6 +2845,15 @@ snprint_def_hw_strmatch(char * buff, int
72 +snprint_def_force_sync(char * buff, int len, void * data)
74 + if (conf->force_sync)
75 + return snprintf(buff, len, "yes");
77 + return snprintf(buff, len, "no");
81 snprint_ble_simple (char * buff, int len, void * data)
83 struct blentry * ble = (struct blentry *)data;
84 @@ -2889,6 +2921,7 @@ init_keywords(void)
85 install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler);
86 install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
87 install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch);
88 + install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync);
89 __deprecated install_keyword("default_selector", &def_selector_handler, NULL);
90 __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
91 __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
92 Index: multipath-tools-130222/libmultipath/discovery.c
93 ===================================================================
94 --- multipath-tools-130222.orig/libmultipath/discovery.c
95 +++ multipath-tools-130222/libmultipath/discovery.c
96 @@ -952,8 +952,12 @@ get_state (struct path * pp, int daemon)
99 checker_clear_message(c);
101 - checker_set_async(c);
103 + if (conf->force_sync == 0)
104 + checker_set_async(c);
106 + checker_set_sync(c);
108 if (!conf->checker_timeout &&
109 (pp->bus != SYSFS_BUS_SCSI ||
110 sysfs_get_timeout(pp, &(c->timeout))))
111 Index: multipath-tools-130222/multipath.conf.annotated
112 ===================================================================
113 --- multipath-tools-130222.orig/multipath.conf.annotated
114 +++ multipath-tools-130222/multipath.conf.annotated
117 # # default : determined by the OS
121 # # name : bindings_file
122 # # scope : multipath
123 # # desc : The location of the bindings file that is used with
125 # # default : "/var/lib/multipath/bindings"
126 # bindings_file "/etc/multipath_bindings"
129 +# # name : force_sync
130 +# # scope : multipathd
131 +# # desc : If set to yes, multipath will run all of the checkers in
132 +# # sync mode, even if the checker has an async mode.
139 Index: multipath-tools-130222/multipath/multipath.conf.5
140 ===================================================================
141 --- multipath-tools-130222.orig/multipath/multipath.conf.5
142 +++ multipath-tools-130222/multipath/multipath.conf.5
143 @@ -411,6 +411,15 @@ modify an existing config, or create a n
144 , the user device configs will be regular expression matched against the
145 built-in configs instead. Default is
151 +, multipathd will call the path checkers in sync mode only. This means that
152 +only one checker will run at a time. This is useful in the case where many
153 +multipathd checkers running in parallel causes significant CPU pressure. The
157 .SH "blacklist section"