Blame SOURCES/0004-RH-multipathd-blacklist-all-by-default.patch

f20720
From 61b2002c6b2752c15b431e400cd614edc8c5b039 Mon Sep 17 00:00:00 2001
f20720
From: Fabio M. Di Nitto <fdinitto@redhat.com>
f20720
Date: Mon, 19 Oct 2009 07:05:45 +0200
f20720
Subject: [PATCH 09/12] RH: multipathd blacklist all by default
f20720
f20720
If there is no configuration installed on the system, blacklist
f20720
everything by default.
f20720
f20720
BZ#528059
f20720
f20720
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
f20720
---
f20720
:100644 100644 e7e962e... 5aa1ab0... M	libmultipath/config.c
f20720
:100644 100644 86b1320... 7e90e75... M	libmultipath/config.h
f20720
 libmultipath/config.c |   16 ++++++++++++++++
f20720
 libmultipath/config.h |    1 +
f20720
 2 files changed, 17 insertions(+)
f20720
f20720
Index: multipath-tools-130222/libmultipath/config.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/config.c
f20720
+++ multipath-tools-130222/libmultipath/config.c
f20720
@@ -21,6 +21,7 @@
f20720
 #include "defaults.h"
f20720
 #include "prio.h"
f20720
 #include "devmapper.h"
f20720
+#include "version.h"
f20720
 
f20720
 static int
f20720
 hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
f20720
@@ -585,6 +586,21 @@ load_config (char * file)
f20720
 
f20720
 	} else {
f20720
 		init_keywords();
f20720
+		condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
f20720
+		condlog(0, "A default multipath.conf file is located at");
f20720
+		condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE));
f20720
+		if (conf->blist_devnode == NULL) {
f20720
+			conf->blist_devnode = vector_alloc();
f20720
+			if (!conf->blist_devnode) {
f20720
+				condlog(0, "cannot allocate blacklist\n");
f20720
+				goto out;
f20720
+			}
f20720
+		}
f20720
+		if (store_ble(conf->blist_devnode, strdup(".*"),
f20720
+		              ORIGIN_NO_CONFIG)) {
f20720
+			condlog(0, "cannot store default no-config blacklist\n");
f20720
+			goto out;
f20720
+		}
f20720
 	}
f20720
 
f20720
 	/*
f20720
Index: multipath-tools-130222/libmultipath/config.h
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/config.h
f20720
+++ multipath-tools-130222/libmultipath/config.h
f20720
@@ -6,6 +6,7 @@
f20720
 
f20720
 #define ORIGIN_DEFAULT 0
f20720
 #define ORIGIN_CONFIG  1
f20720
+#define ORIGIN_NO_CONFIG 2
f20720
 
f20720
 /*
f20720
  * In kernel, fast_io_fail == 0 means immediate failure on rport delete.