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

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