Blame SOURCES/0126-RHBZ-1211383-alias-collision.patch

4728c8
---
4728c8
 libmultipath/config.c    |    4 ++++
4728c8
 libmultipath/config.h    |    1 +
4728c8
 libmultipath/configure.c |    3 +++
4728c8
 libmultipath/dict.c      |   33 +++++++++++++++++++++++++++++++++
4728c8
 4 files changed, 41 insertions(+)
4728c8
4728c8
Index: multipath-tools-130222/libmultipath/configure.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/configure.c
4728c8
+++ multipath-tools-130222/libmultipath/configure.c
4728c8
@@ -422,6 +422,9 @@ select_action (struct multipath * mpp, v
4728c8
 		condlog(2, "%s: unable to rename %s to %s (%s is used by %s)",
4728c8
 			mpp->wwid, cmpp->alias, mpp->alias,
4728c8
 			mpp->alias, cmpp_by_name->wwid);
4728c8
+		/* reset alias to existing alias */
4728c8
+		FREE(mpp->alias);
4728c8
+		mpp->alias = STRDUP(cmpp->alias);
4728c8
 		mpp->action = ACT_NOTHING;
4728c8
 		return;
4728c8
 	}
4728c8
Index: multipath-tools-130222/libmultipath/config.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/config.c
4728c8
+++ multipath-tools-130222/libmultipath/config.c
4728c8
@@ -675,6 +675,7 @@ load_config (char * file, struct udev *u
4728c8
 	conf->processed_main_config = 0;
4728c8
 	conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES;
4728c8
 	conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY;
4728c8
+	conf->new_bindings_in_boot = 0;
4728c8
 
4728c8
 	/*
4728c8
 	 * preload default hwtable
4728c8
@@ -794,6 +795,9 @@ load_config (char * file, struct udev *u
4728c8
 	if (conf->ignore_new_boot_devs)
4728c8
 		in_initrd();
4728c8
 
4728c8
+	if (conf->new_bindings_in_boot == 0 && in_initrd())
4728c8
+		conf->bindings_read_only = 1;
4728c8
+
4728c8
 	return 0;
4728c8
 out:
4728c8
 	free_config(conf);
4728c8
Index: multipath-tools-130222/libmultipath/config.h
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/config.h
4728c8
+++ multipath-tools-130222/libmultipath/config.h
4728c8
@@ -141,6 +141,7 @@ struct config {
4728c8
 	int delay_wait_checks;
4728c8
 	int retrigger_tries;
4728c8
 	int retrigger_delay;
4728c8
+	int new_bindings_in_boot;
4728c8
 	unsigned int version[3];
4728c8
 
4728c8
 	char * dev;
4728c8
Index: multipath-tools-130222/libmultipath/dict.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/dict.c
4728c8
+++ multipath-tools-130222/libmultipath/dict.c
4728c8
@@ -871,6 +871,29 @@ def_retrigger_delay_handler(vector strve
4728c8
 	return 0;
4728c8
 }
4728c8
 
4728c8
+static int
4728c8
+def_new_bindings_in_boot_handler(vector strvec)
4728c8
+{
4728c8
+	char * buff;
4728c8
+
4728c8
+	buff = set_value(strvec);
4728c8
+
4728c8
+	if (!buff)
4728c8
+		return 1;
4728c8
+
4728c8
+	if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
4728c8
+	    (strlen(buff) == 1 && !strcmp(buff, "0")))
4728c8
+		conf->new_bindings_in_boot = 0;
4728c8
+	else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
4728c8
+		 (strlen(buff) == 1 && !strcmp(buff, "1")))
4728c8
+		conf->new_bindings_in_boot = 1;
4728c8
+	else
4728c8
+		conf->new_bindings_in_boot = 0;
4728c8
+
4728c8
+	FREE(buff);
4728c8
+	return 0;
4728c8
+}
4728c8
+
4728c8
 /*
4728c8
  * blacklist block handlers
4728c8
  */
4728c8
@@ -3238,6 +3261,15 @@ snprint_def_retrigger_delay (char * buff
4728c8
 }
4728c8
 
4728c8
 static int
4728c8
+snprint_def_new_bindings_in_boot(char * buff, int len, void * data)
4728c8
+{
4728c8
+	if (conf->new_bindings_in_boot == 1)
4728c8
+		return snprintf(buff, len, "yes");
4728c8
+	else
4728c8
+		return snprintf(buff, len, "no");
4728c8
+}
4728c8
+
4728c8
+static int
4728c8
 snprint_ble_simple (char * buff, int len, void * data)
4728c8
 {
4728c8
 	struct blentry * ble = (struct blentry *)data;
4728c8
@@ -3313,6 +3345,7 @@ init_keywords(void)
4728c8
 	install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks);
4728c8
 	install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries);
4728c8
 	install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay);
4728c8
+	install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot);
4728c8
 	__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
4728c8
 	__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
4728c8
 	__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);