]>
Commit | Line | Data |
---|---|---|
d8602e2a SS |
1 | From 61b2002c6b2752c15b431e400cd614edc8c5b039 Mon Sep 17 00:00:00 2001 |
2 | From: Fabio M. Di Nitto <fdinitto@redhat.com> | |
3 | Date: Mon, 19 Oct 2009 07:05:45 +0200 | |
4 | Subject: [PATCH 09/12] RH: multipathd blacklist all by default | |
5 | ||
6 | If there is no configuration installed on the system, blacklist | |
7 | everything by default. | |
8 | ||
9 | BZ#528059 | |
10 | ||
11 | Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com> | |
12 | --- | |
13 | :100644 100644 e7e962e... 5aa1ab0... M libmultipath/config.c | |
14 | :100644 100644 86b1320... 7e90e75... M libmultipath/config.h | |
15 | libmultipath/config.c | 16 ++++++++++++++++ | |
16 | libmultipath/config.h | 1 + | |
17 | 2 files changed, 17 insertions(+) | |
18 | ||
289c5516 | 19 | Index: multipath-tools-130222/libmultipath/config.c |
d8602e2a | 20 | =================================================================== |
289c5516 MT |
21 | --- multipath-tools-130222.orig/libmultipath/config.c |
22 | +++ multipath-tools-130222/libmultipath/config.c | |
d8602e2a SS |
23 | @@ -21,6 +21,7 @@ |
24 | #include "defaults.h" | |
25 | #include "prio.h" | |
26 | #include "devmapper.h" | |
27 | +#include "version.h" | |
28 | ||
29 | static int | |
30 | hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) | |
289c5516 | 31 | @@ -585,6 +586,21 @@ load_config (char * file) |
d8602e2a SS |
32 | |
33 | } else { | |
34 | init_keywords(); | |
35 | + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); | |
36 | + condlog(0, "A default multipath.conf file is located at"); | |
37 | + condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); | |
38 | + if (conf->blist_devnode == NULL) { | |
39 | + conf->blist_devnode = vector_alloc(); | |
40 | + if (!conf->blist_devnode) { | |
41 | + condlog(0, "cannot allocate blacklist\n"); | |
42 | + goto out; | |
43 | + } | |
44 | + } | |
45 | + if (store_ble(conf->blist_devnode, strdup(".*"), | |
46 | + ORIGIN_NO_CONFIG)) { | |
47 | + condlog(0, "cannot store default no-config blacklist\n"); | |
48 | + goto out; | |
49 | + } | |
50 | } | |
51 | ||
52 | /* | |
289c5516 | 53 | Index: multipath-tools-130222/libmultipath/config.h |
d8602e2a | 54 | =================================================================== |
289c5516 MT |
55 | --- multipath-tools-130222.orig/libmultipath/config.h |
56 | +++ multipath-tools-130222/libmultipath/config.h | |
d8602e2a SS |
57 | @@ -6,6 +6,7 @@ |
58 | ||
59 | #define ORIGIN_DEFAULT 0 | |
60 | #define ORIGIN_CONFIG 1 | |
61 | +#define ORIGIN_NO_CONFIG 2 | |
62 | ||
63 | /* | |
64 | * In kernel, fast_io_fail == 0 means immediate failure on rport delete. |