Blame SOURCES/0089-RHBZ-1110016-add-noasync-option.patch

4ae388
---
4ae388
 libmultipath/config.c      |    1 +
4ae388
 libmultipath/config.h      |    1 +
4ae388
 libmultipath/dict.c        |   33 +++++++++++++++++++++++++++++++++
4ae388
 libmultipath/discovery.c   |    8 ++++++--
4ae388
 multipath.conf.annotated   |   10 ++++++++++
4ae388
 multipath/multipath.conf.5 |    9 +++++++++
4ae388
 6 files changed, 60 insertions(+), 2 deletions(-)
4ae388
4ae388
Index: multipath-tools-130222/libmultipath/config.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/config.c
4ae388
+++ multipath-tools-130222/libmultipath/config.c
4ae388
@@ -556,6 +556,7 @@ load_config (char * file, struct udev *u
4ae388
 	conf->retain_hwhandler = DEFAULT_RETAIN_HWHANDLER;
4ae388
 	conf->detect_prio = DEFAULT_DETECT_PRIO;
4ae388
 	conf->hw_strmatch = 0;
4ae388
+	conf->force_sync = 0;
4ae388
 
4ae388
 	/*
4ae388
 	 * preload default hwtable
4ae388
Index: multipath-tools-130222/libmultipath/config.h
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/config.h
4ae388
+++ multipath-tools-130222/libmultipath/config.h
4ae388
@@ -115,6 +115,7 @@ struct config {
4ae388
 	int reassign_maps;
4ae388
 	int retain_hwhandler;
4ae388
 	int detect_prio;
4ae388
+	int force_sync;
4ae388
 	unsigned int version[3];
4ae388
 
4ae388
 	char * dev;
4ae388
Index: multipath-tools-130222/libmultipath/dict.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/dict.c
4ae388
+++ multipath-tools-130222/libmultipath/dict.c
4ae388
@@ -712,6 +712,29 @@ def_hw_strmatch_handler(vector strvec)
4ae388
 	return 0;
4ae388
 }
4ae388
 
4ae388
+static int
4ae388
+def_force_sync_handler(vector strvec)
4ae388
+{
4ae388
+	char * buff;
4ae388
+
4ae388
+	buff = set_value(strvec);
4ae388
+
4ae388
+	if (!buff)
4ae388
+		return 1;
4ae388
+
4ae388
+	if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
4ae388
+	    (strlen(buff) == 1 && !strcmp(buff, "0")))
4ae388
+		conf->force_sync = 0;
4ae388
+	else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
4ae388
+		 (strlen(buff) == 1 && !strcmp(buff, "1")))
4ae388
+		conf->force_sync = 1;
4ae388
+	else
4ae388
+		conf->force_sync = 0;
4ae388
+
4ae388
+	FREE(buff);
4ae388
+	return 0;
4ae388
+}
4ae388
+
4ae388
 /*
4ae388
  * blacklist block handlers
4ae388
  */
4ae388
@@ -2822,6 +2845,15 @@ snprint_def_hw_strmatch(char * buff, int
4ae388
 }
4ae388
 
4ae388
 static int
4ae388
+snprint_def_force_sync(char * buff, int len, void * data)
4ae388
+{
4ae388
+	if (conf->force_sync)
4ae388
+		return snprintf(buff, len, "yes");
4ae388
+	else
4ae388
+		return snprintf(buff, len, "no");
4ae388
+}
4ae388
+
4ae388
+static int
4ae388
 snprint_ble_simple (char * buff, int len, void * data)
4ae388
 {
4ae388
 	struct blentry * ble = (struct blentry *)data;
4ae388
@@ -2889,6 +2921,7 @@ init_keywords(void)
4ae388
 	install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler_handler);
4ae388
 	install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio);
4ae388
 	install_keyword("hw_str_match", &def_hw_strmatch_handler, &snprint_def_hw_strmatch);
4ae388
+	install_keyword("force_sync", &def_force_sync_handler, &snprint_def_force_sync);
4ae388
 	__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
4ae388
 	__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
4ae388
 	__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
4ae388
Index: multipath-tools-130222/libmultipath/discovery.c
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/libmultipath/discovery.c
4ae388
+++ multipath-tools-130222/libmultipath/discovery.c
4ae388
@@ -952,8 +952,12 @@ get_state (struct path * pp, int daemon)
4ae388
 		}
4ae388
 	}
4ae388
 	checker_clear_message(c);
4ae388
-	if (daemon)
4ae388
-		checker_set_async(c);
4ae388
+	if (daemon) {
4ae388
+		if (conf->force_sync == 0)
4ae388
+			checker_set_async(c);
4ae388
+		else
4ae388
+			checker_set_sync(c);
4ae388
+	}
4ae388
 	if (!conf->checker_timeout &&
4ae388
 	    (pp->bus != SYSFS_BUS_SCSI ||
4ae388
 	     sysfs_get_timeout(pp, &(c->timeout))))
4ae388
Index: multipath-tools-130222/multipath.conf.annotated
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/multipath.conf.annotated
4ae388
+++ multipath-tools-130222/multipath.conf.annotated
4ae388
@@ -214,6 +214,8 @@
4ae388
 #	# values  : n > 0
4ae388
 #	# default : determined by the OS
4ae388
 #	dev_loss_tmo 600
4ae388
+#
4ae388
+#	#
4ae388
 #	# name    : bindings_file
4ae388
 #	# scope   : multipath
4ae388
 #	# desc    : The location of the bindings file that is used with
4ae388
@@ -222,6 +224,14 @@
4ae388
 #	# default : "/var/lib/multipath/bindings"
4ae388
 #	bindings_file "/etc/multipath_bindings"
4ae388
 #
4ae388
+#	#
4ae388
+#	# name    : force_sync
4ae388
+#	# scope   : multipathd
4ae388
+#	# desc    : If set to yes, multipath will run all of the checkers in
4ae388
+#	#           sync mode, even if the checker has an async mode.
4ae388
+#	# values  : yes|no
4ae388
+#	# default : no
4ae388
+#	force_sync yes
4ae388
 #}
4ae388
 #	
4ae388
 ##
4ae388
Index: multipath-tools-130222/multipath/multipath.conf.5
4ae388
===================================================================
4ae388
--- multipath-tools-130222.orig/multipath/multipath.conf.5
4ae388
+++ multipath-tools-130222/multipath/multipath.conf.5
4ae388
@@ -411,6 +411,15 @@ modify an existing config, or create a n
4ae388
 , the user device configs will be regular expression matched against the
4ae388
 built-in configs instead. Default is
4ae388
 .I no
4ae388
+.TP
4ae388
+.B force_sync
4ae388
+If set to
4ae388
+.I yes
4ae388
+, multipathd will call the path checkers in sync mode only.  This means that
4ae388
+only one checker will run at a time.  This is useful in the case where many
4ae388
+multipathd checkers running in parallel causes significant CPU pressure. The
4ae388
+Default is
4ae388
+.I no
4ae388
 .
4ae388
 .SH "blacklist section"
4ae388
 The