]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - multipath-tools/patches/0089-RHBZ-1110016-add-noasync-option.patch
multipath-tools: Update to snapshot from 2013-02-22
[people/stevee/ipfire-3.x.git] / multipath-tools / patches / 0089-RHBZ-1110016-add-noasync-option.patch
CommitLineData
289c5516
MT
1---
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(-)
9
10Index: 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;
19
20 /*
21 * preload default hwtable
22Index: 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 {
27 int reassign_maps;
28 int retain_hwhandler;
29 int detect_prio;
30+ int force_sync;
31 unsigned int version[3];
32
33 char * dev;
34Index: 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)
39 return 0;
40 }
41
42+static int
43+def_force_sync_handler(vector strvec)
44+{
45+ char * buff;
46+
47+ buff = set_value(strvec);
48+
49+ if (!buff)
50+ return 1;
51+
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;
58+ else
59+ conf->force_sync = 0;
60+
61+ FREE(buff);
62+ return 0;
63+}
64+
65 /*
66 * blacklist block handlers
67 */
68@@ -2822,6 +2845,15 @@ snprint_def_hw_strmatch(char * buff, int
69 }
70
71 static int
72+snprint_def_force_sync(char * buff, int len, void * data)
73+{
74+ if (conf->force_sync)
75+ return snprintf(buff, len, "yes");
76+ else
77+ return snprintf(buff, len, "no");
78+}
79+
80+static int
81 snprint_ble_simple (char * buff, int len, void * data)
82 {
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);
92Index: 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)
97 }
98 }
99 checker_clear_message(c);
100- if (daemon)
101- checker_set_async(c);
102+ if (daemon) {
103+ if (conf->force_sync == 0)
104+ checker_set_async(c);
105+ else
106+ checker_set_sync(c);
107+ }
108 if (!conf->checker_timeout &&
109 (pp->bus != SYSFS_BUS_SCSI ||
110 sysfs_get_timeout(pp, &(c->timeout))))
111Index: multipath-tools-130222/multipath.conf.annotated
112===================================================================
113--- multipath-tools-130222.orig/multipath.conf.annotated
114+++ multipath-tools-130222/multipath.conf.annotated
115@@ -214,6 +214,8 @@
116 # # values : n > 0
117 # # default : determined by the OS
118 # dev_loss_tmo 600
119+#
120+# #
121 # # name : bindings_file
122 # # scope : multipath
123 # # desc : The location of the bindings file that is used with
124@@ -222,6 +224,14 @@
125 # # default : "/var/lib/multipath/bindings"
126 # bindings_file "/etc/multipath_bindings"
127 #
128+# #
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.
133+# # values : yes|no
134+# # default : no
135+# force_sync yes
136 #}
137 #
138 ##
139Index: 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
146 .I no
147+.TP
148+.B force_sync
149+If set to
150+.I yes
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
154+Default is
155+.I no
156 .
157 .SH "blacklist section"
158 The