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

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