diff options
41 files changed, 4123 insertions, 706 deletions
diff --git a/meta-oe/recipes-support/multipath-tools/files/0001-kpartx-include-limits.h-for-PATH_MAX.patch b/meta-oe/recipes-support/multipath-tools/files/0001-kpartx-include-limits.h-for-PATH_MAX.patch deleted file mode 100644 index 46dd8e23b4..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0001-kpartx-include-limits.h-for-PATH_MAX.patch +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | From 330028a5a904a0da3788141030e614569dc5aaa7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 14 Jul 2017 23:28:12 -0700 | ||
4 | Subject: [PATCH] kpartx: include limits.h for PATH_MAX | ||
5 | |||
6 | lopart.c:76:12: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'INT8_MAX'? | ||
7 | char path[PATH_MAX]; | ||
8 | ^~~~~~~~ | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | kpartx/lopart.c | 1 + | ||
13 | 1 file changed, 1 insertion(+) | ||
14 | |||
15 | diff --git a/kpartx/lopart.c b/kpartx/lopart.c | ||
16 | index 7005445..5efe5dc 100644 | ||
17 | --- a/kpartx/lopart.c | ||
18 | +++ b/kpartx/lopart.c | ||
19 | @@ -22,6 +22,7 @@ | ||
20 | #include <errno.h> | ||
21 | #include <stdlib.h> | ||
22 | #include <unistd.h> | ||
23 | +#include <limits.h> | ||
24 | #include <sys/ioctl.h> | ||
25 | #include <sys/stat.h> | ||
26 | #include <sys/mman.h> | ||
27 | -- | ||
28 | 2.13.3 | ||
29 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0001-multipath-attempt-at-common-multipath.rules.patch b/meta-oe/recipes-support/multipath-tools/files/0001-multipath-attempt-at-common-multipath.rules.patch deleted file mode 100644 index acb4269543..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0001-multipath-attempt-at-common-multipath.rules.patch +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | From 5ab50e0cb888e553a2635bbbf81eea3cdeffee60 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Wed, 12 Apr 2017 09:07:51 -0500 | ||
4 | Subject: [PATCH 01/14] multipath: attempt at common multipath.rules | ||
5 | |||
6 | This is a proposal to try and bring the Redhat and SuSE multipath.rules | ||
7 | closer. There are a couple of changes that I'd like some input on. | ||
8 | |||
9 | The big change is moving the kpartx call into the multipath rules. Half | ||
10 | of the current kpartx.rules file is about creating symlinks for multiple | ||
11 | types of dm devices. The other half auto-creates kpartx devices on top | ||
12 | of multipath devices. Since it is only creating kpartx devices on top of | ||
13 | multipath devices, I've moved the these rules into multipath.rules, or | ||
14 | rather, I've replaced them with the redhat rules in multipath.rules. The | ||
15 | biggest difference is the kpartx isn't run on every reload. It works | ||
16 | with the 11-dm-mpath.rules code to not run kpartx on multipathd | ||
17 | generated reloads or when there aren't any working paths. It does | ||
18 | remember if it didn't get to run kpartx when it was supposed to (because | ||
19 | there were no valid paths or the device was suspended) and will make | ||
20 | sure to run it on the next possible uevent. | ||
21 | |||
22 | The other change is the redhat multipath rules remove the partition | ||
23 | device nodes for devices claimed by multipath. The udev rule will only | ||
24 | do this one time (both to keep from running partx on every event, and so | ||
25 | that if users manually reread the partition table, we don't keep | ||
26 | removing them when clearly they are wanted). Redhat does this because we | ||
27 | had multiple customer issues where they were using the scsi partitions | ||
28 | instead of the kpartx devices. Obviously, with setting the partition | ||
29 | devices to not ready and clearing their fs_type, this isn't essential, | ||
30 | but it has helped make customers do the right thing. | ||
31 | |||
32 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
33 | --- | ||
34 | kpartx/kpartx.rules | 8 -------- | ||
35 | multipath/multipath.rules | 27 ++++++++++++++++++++++++--- | ||
36 | 2 files changed, 24 insertions(+), 11 deletions(-) | ||
37 | |||
38 | diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules | ||
39 | index a958791..906e320 100644 | ||
40 | --- a/kpartx/kpartx.rules | ||
41 | +++ b/kpartx/kpartx.rules | ||
42 | @@ -34,12 +34,4 @@ ENV{ID_FS_LABEL_ENC}=="?*", IMPORT{db}="ID_FS_LABEL_ENC" | ||
43 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", \ | ||
44 | SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" | ||
45 | |||
46 | -# Create dm tables for partitions | ||
47 | -ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", GOTO="kpartx_end" | ||
48 | -ENV{DM_NR_VALID_PATHS}=="0", GOTO="kpartx_end" | ||
49 | -ENV{ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG1" | ||
50 | -ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="kpartx_end" | ||
51 | -ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \ | ||
52 | - RUN+="/sbin/kpartx -un -p -part /dev/$name" | ||
53 | - | ||
54 | LABEL="kpartx_end" | ||
55 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules | ||
56 | index 86defc0..616a04c 100644 | ||
57 | --- a/multipath/multipath.rules | ||
58 | +++ b/multipath/multipath.rules | ||
59 | @@ -1,13 +1,13 @@ | ||
60 | # Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath | ||
61 | SUBSYSTEM!="block", GOTO="end_mpath" | ||
62 | ACTION!="add|change", GOTO="end_mpath" | ||
63 | -KERNEL!="sd*|dasd*", GOTO="end_mpath" | ||
64 | - | ||
65 | +KERNEL!="sd*|dasd*|rbd*|dm-*", GOTO="end_mpath" | ||
66 | IMPORT{cmdline}="nompath" | ||
67 | ENV{nompath}=="?*", GOTO="end_mpath" | ||
68 | IMPORT{cmdline}="multipath" | ||
69 | ENV{multipath}=="off", GOTO="end_mpath" | ||
70 | |||
71 | +KERNEL=="dm-*", GOTO="check_kpartx" | ||
72 | ENV{DEVTYPE}!="partition", GOTO="test_dev" | ||
73 | IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH" | ||
74 | ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{ID_FS_TYPE}="none", \ | ||
75 | @@ -21,7 +21,28 @@ TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" | ||
76 | |||
77 | ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \ | ||
78 | PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -u %k", \ | ||
79 | - ENV{DM_MULTIPATH_DEVICE_PATH}="1", ENV{ID_FS_TYPE}="none", \ | ||
80 | + ENV{DM_MULTIPATH_DEVICE_PATH}="1", ENV{ID_FS_TYPE}="mpath_member", \ | ||
81 | ENV{SYSTEMD_READY}="0" | ||
82 | |||
83 | +ENV{DM_MULTIPATH_DEVICE_PATH}!="1", GOTO="end_mpath" | ||
84 | + | ||
85 | +IMPORT{db}="DM_MULTIPATH_WIPE_PARTS" | ||
86 | +ENV{DM_MULTIPATH_WIPE_PARTS}!="1", ENV{DM_MULTIPATH_WIPE_PARTS}="1", \ | ||
87 | + RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" | ||
88 | +GOTO="end_mpath" | ||
89 | + | ||
90 | +LABEL="check_kpartx" | ||
91 | + | ||
92 | +IMPORT{db}="DM_MULTIPATH_NEED_KPARTX" | ||
93 | +ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG1" | ||
94 | +ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="end_mpath" | ||
95 | +ACTION!="change", GOTO="end_mpath" | ||
96 | +ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath" | ||
97 | +ENV{DM_ACTIVATION}=="1", ENV{DM_MULTIPATH_NEED_KPARTX}="1" | ||
98 | +ENV{DM_SUSPENDED}=="1", GOTO="end_mpath" | ||
99 | +ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" | ||
100 | +ENV{DM_ACTIVATION}!="1", ENV{DM_MULTIPATH_NEED_KPARTX}!="1", GOTO="end_mpath" | ||
101 | +RUN+="/sbin/kpartx -un -p -part /dev/$name" | ||
102 | +ENV{DM_MULTIPATH_NEED_KPARTX}="" | ||
103 | + | ||
104 | LABEL="end_mpath" | ||
105 | -- | ||
106 | 2.8.1 | ||
107 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch b/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch new file mode 100644 index 0000000000..1d983e978f --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Wed, 11 Apr 2018 15:14:13 +0200 | ||
4 | Subject: [PATCH] multipath-tools: add RDAC SUN/ArrayStorage to hwtable | ||
5 | |||
6 | Already in scsi_dh: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/scsi_dh.c#n70 | ||
7 | |||
8 | Cc: NetApp RDAC team <ng-eseries-upstream-maintainers@netapp.com> | ||
9 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
10 | Cc: DM ML <dm-devel@redhat.com> | ||
11 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | libmultipath/hwtable.c | 12 ++++++++++++ | ||
15 | 1 file changed, 12 insertions(+) | ||
16 | |||
17 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
18 | index 88b4700..827e899 100644 | ||
19 | --- a/libmultipath/hwtable.c | ||
20 | +++ b/libmultipath/hwtable.c | ||
21 | @@ -890,6 +890,18 @@ static struct hwentry default_hw[] = { | ||
22 | .no_path_retry = 30, | ||
23 | }, | ||
24 | { | ||
25 | + .vendor = "SUN", | ||
26 | + .product = "ArrayStorage", | ||
27 | + .bl_product = "Universal Xport", | ||
28 | + .pgpolicy = GROUP_BY_PRIO, | ||
29 | + .checker_name = RDAC, | ||
30 | + .features = "2 pg_init_retries 50", | ||
31 | + .hwhandler = "1 rdac", | ||
32 | + .prio_name = PRIO_RDAC, | ||
33 | + .pgfailback = -FAILBACK_IMMEDIATE, | ||
34 | + .no_path_retry = 30, | ||
35 | + }, | ||
36 | + { | ||
37 | /* ZFS Storage Appliances */ | ||
38 | .vendor = "SUN", | ||
39 | .product = "(Sun Storage|ZFS Storage|COMSTAR)", | ||
40 | -- | ||
41 | 2.7.4 | ||
42 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0002-RH-fixup-udev-rules-for-redhat.patch b/meta-oe/recipes-support/multipath-tools/files/0002-RH-fixup-udev-rules-for-redhat.patch deleted file mode 100644 index e63d2eb33f..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0002-RH-fixup-udev-rules-for-redhat.patch +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | From 158255383c02d3fb81c82fb9ec6fd36fb234f68e Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Thu, 13 Apr 2017 07:22:23 -0500 | ||
4 | Subject: [PATCH 02/14] RH: fixup udev rules for redhat | ||
5 | |||
6 | The multipath rules need to run after scsi_id is run. This means moving | ||
7 | them after 60-persistent-storage.rules for redhat. Also, we don't | ||
8 | currently set up all the symlinks that SuSE does. If we want them, they | ||
9 | should be done in the device-mapper package, since they are for all | ||
10 | device-mapper devices. Redhat also uses a different naming scheme for | ||
11 | partitions than SuSE. | ||
12 | |||
13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
14 | --- | ||
15 | Makefile.inc | 2 +- | ||
16 | kpartx/Makefile | 14 +++++++------- | ||
17 | multipath/Makefile | 4 ++-- | ||
18 | multipath/multipath.rules | 3 ++- | ||
19 | 4 files changed, 12 insertions(+), 11 deletions(-) | ||
20 | |||
21 | diff --git a/Makefile.inc b/Makefile.inc | ||
22 | index 1815f9a..2591fa9 100644 | ||
23 | --- a/Makefile.inc | ||
24 | +++ b/Makefile.inc | ||
25 | @@ -47,7 +47,7 @@ endif | ||
26 | |||
27 | prefix = | ||
28 | exec_prefix = $(prefix) | ||
29 | -bindir = $(exec_prefix)/sbin | ||
30 | +bindir = $(exec_prefix)/usr/sbin | ||
31 | libudevdir = $(prefix)/$(SYSTEMDPATH)/udev | ||
32 | udevrulesdir = $(libudevdir)/rules.d | ||
33 | multipathdir = $(TOPDIR)/libmultipath | ||
34 | diff --git a/kpartx/Makefile b/kpartx/Makefile | ||
35 | index 7b75032..bfa6fe8 100644 | ||
36 | --- a/kpartx/Makefile | ||
37 | +++ b/kpartx/Makefile | ||
38 | @@ -26,19 +26,19 @@ $(EXEC): $(OBJS) | ||
39 | install: $(EXEC) $(EXEC).8 | ||
40 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) | ||
41 | $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) | ||
42 | - $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir) | ||
43 | - $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir) | ||
44 | - $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)/rules.d | ||
45 | - $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)$(libudevdir)/rules.d/66-kpartx.rules | ||
46 | +# $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir) | ||
47 | +# $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir) | ||
48 | +# $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)/rules.d | ||
49 | +# $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)$(libudevdir)/rules.d/66-kpartx.rules | ||
50 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir) | ||
51 | $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir) | ||
52 | |||
53 | uninstall: | ||
54 | $(RM) $(DESTDIR)$(bindir)/$(EXEC) | ||
55 | $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz | ||
56 | - $(RM) $(DESTDIR)$(libudevdir)/kpartx_id | ||
57 | - $(RM) $(DESTDIR)$(libudevdir)/rules.d/66-kpartx.rules | ||
58 | - $(RM) $(DESTDIR)$(libudevdir)/rules.d/67-kpartx-compat.rules | ||
59 | +# $(RM) $(DESTDIR)$(libudevdir)/kpartx_id | ||
60 | +# $(RM) $(DESTDIR)$(libudevdir)/rules.d/66-kpartx.rules | ||
61 | +# $(RM) $(DESTDIR)$(libudevdir)/rules.d/67-kpartx-compat.rules | ||
62 | |||
63 | clean: | ||
64 | $(RM) core *.o $(EXEC) *.gz | ||
65 | diff --git a/multipath/Makefile b/multipath/Makefile | ||
66 | index c85314e..1e9ee4b 100644 | ||
67 | --- a/multipath/Makefile | ||
68 | +++ b/multipath/Makefile | ||
69 | @@ -24,7 +24,7 @@ install: | ||
70 | $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ | ||
71 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir) | ||
72 | $(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir) | ||
73 | - $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules | ||
74 | + $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules | ||
75 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir) | ||
76 | $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir) | ||
77 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) | ||
78 | @@ -33,7 +33,7 @@ install: | ||
79 | uninstall: | ||
80 | $(RM) $(DESTDIR)$(bindir)/$(EXEC) | ||
81 | $(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules | ||
82 | - $(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules | ||
83 | + $(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules | ||
84 | $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz | ||
85 | $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz | ||
86 | |||
87 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules | ||
88 | index 616a04c..4d78b98 100644 | ||
89 | --- a/multipath/multipath.rules | ||
90 | +++ b/multipath/multipath.rules | ||
91 | @@ -33,6 +33,7 @@ GOTO="end_mpath" | ||
92 | |||
93 | LABEL="check_kpartx" | ||
94 | |||
95 | +ENV{DM_UUID}=="mpath-?*|part[0-9]*-mpath-?*", OPTIONS+="link_priority=10" | ||
96 | IMPORT{db}="DM_MULTIPATH_NEED_KPARTX" | ||
97 | ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG1" | ||
98 | ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="end_mpath" | ||
99 | @@ -42,7 +43,7 @@ ENV{DM_ACTIVATION}=="1", ENV{DM_MULTIPATH_NEED_KPARTX}="1" | ||
100 | ENV{DM_SUSPENDED}=="1", GOTO="end_mpath" | ||
101 | ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath" | ||
102 | ENV{DM_ACTIVATION}!="1", ENV{DM_MULTIPATH_NEED_KPARTX}!="1", GOTO="end_mpath" | ||
103 | -RUN+="/sbin/kpartx -un -p -part /dev/$name" | ||
104 | +RUN+="/sbin/kpartx -un /dev/$name" | ||
105 | ENV{DM_MULTIPATH_NEED_KPARTX}="" | ||
106 | |||
107 | LABEL="end_mpath" | ||
108 | -- | ||
109 | 2.8.1 | ||
110 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch b/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch new file mode 100644 index 0000000000..73f000aca2 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Tue, 24 Apr 2018 15:03:40 +0200 | ||
4 | Subject: [PATCH] multipath-tools: remove "c" from __cpluscplus, misspelled | ||
5 | |||
6 | found by cppcheck(http://cppcheck.sf.net/): | ||
7 | [libmpathcmd/mpath_cmd.h:24]: (error) Invalid number of character '{' when these macros are defined: '__cpluscplus'. | ||
8 | |||
9 | Cc: Benjamin Marzinski <bmarzins@redhat.com> | ||
10 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
11 | Cc: DM ML <dm-devel@redhat.com> | ||
12 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
14 | --- | ||
15 | libmpathcmd/mpath_cmd.h | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h | ||
19 | index aaa8da9..df9d938 100644 | ||
20 | --- a/libmpathcmd/mpath_cmd.h | ||
21 | +++ b/libmpathcmd/mpath_cmd.h | ||
22 | @@ -20,7 +20,7 @@ | ||
23 | #ifndef LIB_MPATH_CMD_H | ||
24 | #define LIB_MPATH_CMD_H | ||
25 | |||
26 | -#ifdef __cpluscplus | ||
27 | +#ifdef __cplusplus | ||
28 | extern "C" { | ||
29 | #endif | ||
30 | |||
31 | -- | ||
32 | 2.7.4 | ||
33 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch b/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch new file mode 100644 index 0000000000..7358e1ae97 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Thu, 12 Apr 2018 18:17:13 +0200 | ||
4 | Subject: [PATCH] multipath-tools: remove emacs autoconfig of kpartx/gpt.h | ||
5 | |||
6 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
7 | Cc: DM ML <dm-devel@redhat.com> | ||
8 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
10 | --- | ||
11 | kpartx/gpt.h | 19 ------------------- | ||
12 | 1 file changed, 19 deletions(-) | ||
13 | |||
14 | diff --git a/kpartx/gpt.h b/kpartx/gpt.h | ||
15 | index 66ce8f1..7bb54b7 100644 | ||
16 | --- a/kpartx/gpt.h | ||
17 | +++ b/kpartx/gpt.h | ||
18 | @@ -109,22 +109,3 @@ int read_gpt_pt (int fd, struct slice all, struct slice *sp, int ns); | ||
19 | |||
20 | |||
21 | #endif | ||
22 | - | ||
23 | -/* | ||
24 | - * Overrides for Emacs so that we follow Linus's tabbing style. | ||
25 | - * Emacs will notice this stuff at the end of the file and automatically | ||
26 | - * adjust the settings for this buffer only. This must remain at the end | ||
27 | - * of the file. | ||
28 | - * --------------------------------------------------------------------------- | ||
29 | - * Local variables: | ||
30 | - * c-indent-level: 4 | ||
31 | - * c-brace-imaginary-offset: 0 | ||
32 | - * c-brace-offset: -4 | ||
33 | - * c-argdecl-indent: 4 | ||
34 | - * c-label-offset: -4 | ||
35 | - * c-continued-statement-offset: 4 | ||
36 | - * c-continued-brace-offset: 0 | ||
37 | - * indent-tabs-mode: nil | ||
38 | - * tab-width: 8 | ||
39 | - * End: | ||
40 | - */ | ||
41 | -- | ||
42 | 2.7.4 | ||
43 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch b/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch new file mode 100644 index 0000000000..13f18b5761 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch | |||
@@ -0,0 +1,191 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Fri, 11 May 2018 15:42:43 +0200 | ||
4 | Subject: [PATCH] multipath-tools: replace FSF address with a www pointer | ||
5 | |||
6 | Less prone to future modifications, new FSF licences | ||
7 | point exactly to this url: <http://www.gnu.org/licenses/>. | ||
8 | And sending a smail to FSF is outdated. | ||
9 | |||
10 | First clean up was done in 5619a39c433ac3d10a88079593cec1aa6472cbeb | ||
11 | |||
12 | Cc: Martin Wilck <mwilck@suse.com> | ||
13 | Cc: Benjamin Marzinski <bmarzins@redhat.com> | ||
14 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
15 | Cc: DM ML <dm-devel@redhat.com> | ||
16 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
17 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
18 | --- | ||
19 | libmultipath/dm-generic.c | 4 +--- | ||
20 | libmultipath/dm-generic.h | 4 +--- | ||
21 | libmultipath/foreign.c | 4 +--- | ||
22 | libmultipath/foreign.h | 4 +--- | ||
23 | libmultipath/foreign/nvme.c | 4 +--- | ||
24 | libmultipath/generic.c | 4 +--- | ||
25 | libmultipath/generic.h | 4 +--- | ||
26 | tests/dmevents.c | 2 +- | ||
27 | tests/parser.c | 2 +- | ||
28 | tests/uevent.c | 2 +- | ||
29 | tests/util.c | 2 +- | ||
30 | 11 files changed, 11 insertions(+), 25 deletions(-) | ||
31 | |||
32 | diff --git a/libmultipath/dm-generic.c b/libmultipath/dm-generic.c | ||
33 | index bdc9ca0..d752991 100644 | ||
34 | --- a/libmultipath/dm-generic.c | ||
35 | +++ b/libmultipath/dm-generic.c | ||
36 | @@ -12,9 +12,7 @@ | ||
37 | GNU General Public License for more details. | ||
38 | |||
39 | You should have received a copy of the GNU General Public License | ||
40 | - along with this program; if not, write to the Free Software | ||
41 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
42 | - USA. | ||
43 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
44 | */ | ||
45 | |||
46 | #include <stdint.h> | ||
47 | diff --git a/libmultipath/dm-generic.h b/libmultipath/dm-generic.h | ||
48 | index 5d59724..986429f 100644 | ||
49 | --- a/libmultipath/dm-generic.h | ||
50 | +++ b/libmultipath/dm-generic.h | ||
51 | @@ -12,9 +12,7 @@ | ||
52 | GNU General Public License for more details. | ||
53 | |||
54 | You should have received a copy of the GNU General Public License | ||
55 | - along with this program; if not, write to the Free Software | ||
56 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
57 | - USA. | ||
58 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
59 | */ | ||
60 | #ifndef _DM_GENERIC_H | ||
61 | #define _DM_GENERIC_H | ||
62 | diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c | ||
63 | index 7217184..80b399b 100644 | ||
64 | --- a/libmultipath/foreign.c | ||
65 | +++ b/libmultipath/foreign.c | ||
66 | @@ -12,9 +12,7 @@ | ||
67 | GNU General Public License for more details. | ||
68 | |||
69 | You should have received a copy of the GNU General Public License | ||
70 | - along with this program; if not, write to the Free Software | ||
71 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
72 | - USA. | ||
73 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
74 | */ | ||
75 | |||
76 | #include <sys/sysmacros.h> | ||
77 | diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h | ||
78 | index 973f368..697f12f 100644 | ||
79 | --- a/libmultipath/foreign.h | ||
80 | +++ b/libmultipath/foreign.h | ||
81 | @@ -12,9 +12,7 @@ | ||
82 | GNU General Public License for more details. | ||
83 | |||
84 | You should have received a copy of the GNU General Public License | ||
85 | - along with this program; if not, write to the Free Software | ||
86 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
87 | - USA. | ||
88 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
89 | */ | ||
90 | #ifndef _FOREIGN_H | ||
91 | #define _FOREIGN_H | ||
92 | diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c | ||
93 | index 235f75d..280b6bd 100644 | ||
94 | --- a/libmultipath/foreign/nvme.c | ||
95 | +++ b/libmultipath/foreign/nvme.c | ||
96 | @@ -12,9 +12,7 @@ | ||
97 | GNU General Public License for more details. | ||
98 | |||
99 | You should have received a copy of the GNU General Public License | ||
100 | - along with this program; if not, write to the Free Software | ||
101 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
102 | - USA. | ||
103 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
104 | */ | ||
105 | |||
106 | #include <sys/sysmacros.h> | ||
107 | diff --git a/libmultipath/generic.c b/libmultipath/generic.c | ||
108 | index 6f7a2cd..0d1e632 100644 | ||
109 | --- a/libmultipath/generic.c | ||
110 | +++ b/libmultipath/generic.c | ||
111 | @@ -12,9 +12,7 @@ | ||
112 | GNU General Public License for more details. | ||
113 | |||
114 | You should have received a copy of the GNU General Public License | ||
115 | - along with this program; if not, write to the Free Software | ||
116 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
117 | - USA. | ||
118 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
119 | */ | ||
120 | |||
121 | |||
122 | diff --git a/libmultipath/generic.h b/libmultipath/generic.h | ||
123 | index 7f7fe66..6346ffe 100644 | ||
124 | --- a/libmultipath/generic.h | ||
125 | +++ b/libmultipath/generic.h | ||
126 | @@ -12,9 +12,7 @@ | ||
127 | GNU General Public License for more details. | ||
128 | |||
129 | You should have received a copy of the GNU General Public License | ||
130 | - along with this program; if not, write to the Free Software | ||
131 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
132 | - USA. | ||
133 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
134 | */ | ||
135 | #ifndef _GENERIC_H | ||
136 | #define _GENERIC_H | ||
137 | diff --git a/tests/dmevents.c b/tests/dmevents.c | ||
138 | index bba51dc..3399c81 100644 | ||
139 | --- a/tests/dmevents.c | ||
140 | +++ b/tests/dmevents.c | ||
141 | @@ -12,7 +12,7 @@ | ||
142 | * GNU General Public License for more details. | ||
143 | * | ||
144 | * You should have received a copy of the GNU General Public License | ||
145 | - * along with this program; if not, write to the Free Software | ||
146 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
147 | * | ||
148 | */ | ||
149 | |||
150 | diff --git a/tests/parser.c b/tests/parser.c | ||
151 | index a7e7598..29859da 100644 | ||
152 | --- a/tests/parser.c | ||
153 | +++ b/tests/parser.c | ||
154 | @@ -12,7 +12,7 @@ | ||
155 | * GNU General Public License for more details. | ||
156 | * | ||
157 | * You should have received a copy of the GNU General Public License | ||
158 | - * along with this program; if not, write to the Free Software | ||
159 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
160 | * | ||
161 | */ | ||
162 | |||
163 | diff --git a/tests/uevent.c b/tests/uevent.c | ||
164 | index acfcb14..b0d0bfd 100644 | ||
165 | --- a/tests/uevent.c | ||
166 | +++ b/tests/uevent.c | ||
167 | @@ -12,7 +12,7 @@ | ||
168 | * GNU General Public License for more details. | ||
169 | * | ||
170 | * You should have received a copy of the GNU General Public License | ||
171 | - * along with this program; if not, write to the Free Software | ||
172 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
173 | * | ||
174 | */ | ||
175 | |||
176 | diff --git a/tests/util.c b/tests/util.c | ||
177 | index 113b134..839effd 100644 | ||
178 | --- a/tests/util.c | ||
179 | +++ b/tests/util.c | ||
180 | @@ -12,7 +12,7 @@ | ||
181 | * GNU General Public License for more details. | ||
182 | * | ||
183 | * You should have received a copy of the GNU General Public License | ||
184 | - * along with this program; if not, write to the Free Software | ||
185 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
186 | * | ||
187 | */ | ||
188 | |||
189 | -- | ||
190 | 2.7.4 | ||
191 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch b/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch new file mode 100644 index 0000000000..953e739efa --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Fri, 11 May 2018 15:43:11 +0200 | ||
4 | Subject: [PATCH] multipath-tools: Remove trailing/leading whitespaces and | ||
5 | reformat code | ||
6 | |||
7 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
8 | Cc: device-mapper development <dm-devel@redhat.com> | ||
9 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
11 | --- | ||
12 | Makefile.inc | 23 +++++++++++------------ | ||
13 | kpartx/mac.h | 2 +- | ||
14 | kpartx/test-kpartx | 2 +- | ||
15 | libmpathcmd/Makefile | 2 +- | ||
16 | libmultipath/hwtable.c | 14 +++++++------- | ||
17 | libmultipath/print.h | 2 +- | ||
18 | multipathd/main.h | 6 +++--- | ||
19 | 7 files changed, 25 insertions(+), 26 deletions(-) | ||
20 | |||
21 | diff --git a/Makefile.inc b/Makefile.inc | ||
22 | index 57a1835..af2f5ba 100644 | ||
23 | --- a/Makefile.inc | ||
24 | +++ b/Makefile.inc | ||
25 | @@ -103,21 +103,20 @@ LDFLAGS = -Wl,-z,relro -Wl,-z,now | ||
26 | BIN_LDFLAGS = -pie | ||
27 | |||
28 | # Check whether a function with name $1 has been declared in header file $2. | ||
29 | -check_func = \ | ||
30 | - $(shell \ | ||
31 | +check_func = $(shell \ | ||
32 | if grep -Eq "^[^[:blank:]]+[[:blank:]]+$1[[:blank:]]*(.*)*" "$2"; then \ | ||
33 | - found=1; \ | ||
34 | - status="yes"; \ | ||
35 | - else \ | ||
36 | - found=0; \ | ||
37 | - status="no"; \ | ||
38 | - fi; \ | ||
39 | - echo 1>&2 "Checking for $1 in $2 ... $$status"; \ | ||
40 | - echo "$$found" \ | ||
41 | - ) | ||
42 | + found=1; \ | ||
43 | + status="yes"; \ | ||
44 | + else \ | ||
45 | + found=0; \ | ||
46 | + status="no"; \ | ||
47 | + fi; \ | ||
48 | + echo 1>&2 "Checking for $1 in $2 ... $$status"; \ | ||
49 | + echo "$$found" \ | ||
50 | + ) | ||
51 | |||
52 | # Checker whether a file with name $1 exists | ||
53 | -check_file = $(shell \ | ||
54 | +check_file = $(shell \ | ||
55 | if [ -f "$1" ]; then \ | ||
56 | found=1; \ | ||
57 | status="yes"; \ | ||
58 | diff --git a/kpartx/mac.h b/kpartx/mac.h | ||
59 | index a44cf38..55c3ec9 100644 | ||
60 | --- a/kpartx/mac.h | ||
61 | +++ b/kpartx/mac.h | ||
62 | @@ -24,7 +24,7 @@ struct mac_driver_desc { | ||
63 | uint16_t signature; /* expected to be MAC_DRIVER_MAGIC */ | ||
64 | uint16_t block_size; | ||
65 | uint32_t block_count; | ||
66 | - /* ... more stuff */ | ||
67 | + /* ... more stuff */ | ||
68 | }; | ||
69 | |||
70 | #endif | ||
71 | diff --git a/kpartx/test-kpartx b/kpartx/test-kpartx | ||
72 | index 9cee20f..d2001dc 100755 | ||
73 | --- a/kpartx/test-kpartx | ||
74 | +++ b/kpartx/test-kpartx | ||
75 | @@ -131,7 +131,7 @@ step "create DM devices (spans)" | ||
76 | # They also serve as DM devices to test partition removal on those. | ||
77 | |||
78 | TABLE="\ | ||
79 | -0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS | ||
80 | +0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS | ||
81 | $((SIZE/SECTSIZ-OFFS)) $((SIZE/SECTSIZ-OFFS)) linear $DEV2 $OFFS" | ||
82 | |||
83 | SPAN1=kpt | ||
84 | diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile | ||
85 | index 53c0899..0f6b816 100644 | ||
86 | --- a/libmpathcmd/Makefile | ||
87 | +++ b/libmpathcmd/Makefile | ||
88 | @@ -27,7 +27,7 @@ uninstall: | ||
89 | $(RM) $(DESTDIR)$(includedir)/mpath_cmd.h | ||
90 | |||
91 | clean: dep_clean | ||
92 | - $(RM) core *.a *.o *.so *.so.* *.gz | ||
93 | + $(RM) core *.a *.o *.so *.so.* *.gz | ||
94 | |||
95 | include $(wildcard $(OBJS:.o=.d)) | ||
96 | |||
97 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
98 | index 827e899..2ca6888 100644 | ||
99 | --- a/libmultipath/hwtable.c | ||
100 | +++ b/libmultipath/hwtable.c | ||
101 | @@ -78,13 +78,13 @@ | ||
102 | #endif | ||
103 | |||
104 | static struct hwentry default_hw[] = { | ||
105 | - /* | ||
106 | - * Generic NVMe | ||
107 | - * | ||
108 | - * Due to the parsing logic in find_hwe(), generic entries | ||
109 | - * have to be put on top of this list, and more specific ones | ||
110 | - * below. | ||
111 | - */ | ||
112 | + /* | ||
113 | + * Generic NVMe devices | ||
114 | + * | ||
115 | + * Due to the parsing logic in find_hwe(), generic entries | ||
116 | + * have to be put on top of this list, and more specific ones | ||
117 | + * below. | ||
118 | + */ | ||
119 | { | ||
120 | .vendor = "NVME", | ||
121 | .product = ".*", | ||
122 | diff --git a/libmultipath/print.h b/libmultipath/print.h | ||
123 | index 7ba6438..9b5a23a 100644 | ||
124 | --- a/libmultipath/print.h | ||
125 | +++ b/libmultipath/print.h | ||
126 | @@ -113,7 +113,7 @@ int _snprint_multipath (const struct gen_multipath *, char *, int, | ||
127 | const char *, int); | ||
128 | #define snprint_multipath(buf, len, fmt, mp, v) \ | ||
129 | _snprint_multipath(dm_multipath_to_gen(mp), buf, len, fmt, v) | ||
130 | -int _snprint_multipath_topology (const struct gen_multipath *, char *, int, | ||
131 | +int _snprint_multipath_topology (const struct gen_multipath *, char *, int, | ||
132 | int verbosity); | ||
133 | #define snprint_multipath_topology(buf, len, mpp, v) \ | ||
134 | _snprint_multipath_topology (dm_multipath_to_gen(mpp), buf, len, v) | ||
135 | diff --git a/multipathd/main.h b/multipathd/main.h | ||
136 | index af39558..8fd426b 100644 | ||
137 | --- a/multipathd/main.h | ||
138 | +++ b/multipathd/main.h | ||
139 | @@ -29,11 +29,11 @@ int ev_remove_map (char *, char *, int, struct vectors *); | ||
140 | int set_config_state(enum daemon_status); | ||
141 | void * mpath_alloc_prin_response(int prin_sa); | ||
142 | int prin_do_scsi_ioctl(char *, int rq_servact, struct prin_resp * resp, | ||
143 | - int noisy); | ||
144 | + int noisy); | ||
145 | void dumpHex(const char * , int len, int no_ascii); | ||
146 | int prout_do_scsi_ioctl(char * , int rq_servact, int rq_scope, | ||
147 | - unsigned int rq_type, struct prout_param_descriptor *param, | ||
148 | - int noisy); | ||
149 | + unsigned int rq_type, | ||
150 | + struct prout_param_descriptor *param, int noisy); | ||
151 | int mpath_pr_event_handle(struct path *pp); | ||
152 | void * mpath_pr_event_handler_fn (void * ); | ||
153 | int update_map_pr(struct multipath *mpp); | ||
154 | -- | ||
155 | 2.7.4 | ||
156 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch b/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch new file mode 100644 index 0000000000..c6fd5b4cfb --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Fri, 11 May 2018 18:39:44 +0200 | ||
4 | Subject: [PATCH] multipath-tools: fix compilation with musl libc | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | In file included from alias.c:15: | ||
10 | file.h:9:47: error: unknown type name ‘mode_t’; did you mean ‘time_t’? | ||
11 | int ensure_directories_exist(const char *str, mode_t dir_mode); | ||
12 | ^~~~~~ | ||
13 | time_t | ||
14 | |||
15 | sysfs.c: In function ‘sysfs_is_multipathed’: | ||
16 | sysfs.c:304:15: error: ‘PATH_MAX’ undeclared (first use in this function); did you mean ‘PATH_UP’? | ||
17 | char pathbuf[PATH_MAX]; | ||
18 | ^~~~~~~~ | ||
19 | PATH_UP | ||
20 | |||
21 | Cc: Martin Wilck <mwilck@suse.com> | ||
22 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
23 | Cc: DM ML <dm-devel@redhat.com> | ||
24 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
25 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
26 | --- | ||
27 | libmultipath/file.h | 2 ++ | ||
28 | libmultipath/sysfs.c | 1 + | ||
29 | 2 files changed, 3 insertions(+) | ||
30 | |||
31 | diff --git a/libmultipath/file.h b/libmultipath/file.h | ||
32 | index 29520c7..3c75c90 100644 | ||
33 | --- a/libmultipath/file.h | ||
34 | +++ b/libmultipath/file.h | ||
35 | @@ -5,6 +5,8 @@ | ||
36 | #ifndef _FILE_H | ||
37 | #define _FILE_H | ||
38 | |||
39 | +#include <sys/stat.h> | ||
40 | + | ||
41 | #define FILE_TIMEOUT 30 | ||
42 | int ensure_directories_exist(const char *str, mode_t dir_mode); | ||
43 | int open_file(const char *file, int *can_write, const char *header); | ||
44 | diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c | ||
45 | index ee72e6a..16e0a73 100644 | ||
46 | --- a/libmultipath/sysfs.c | ||
47 | +++ b/libmultipath/sysfs.c | ||
48 | @@ -28,6 +28,7 @@ | ||
49 | #include <dirent.h> | ||
50 | #include <libudev.h> | ||
51 | #include <fnmatch.h> | ||
52 | +#include <limits.h> | ||
53 | |||
54 | #include "checkers.h" | ||
55 | #include "vector.h" | ||
56 | -- | ||
57 | 2.7.4 | ||
58 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0007-RH-trigger-change-uevent-on-new-device-creation.patch b/meta-oe/recipes-support/multipath-tools/files/0007-RH-trigger-change-uevent-on-new-device-creation.patch deleted file mode 100644 index 025a3512e3..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0007-RH-trigger-change-uevent-on-new-device-creation.patch +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | From 0d2c9afbd89d79fd700f9c99aa20e5f7c7382027 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Mon, 24 Apr 2017 09:39:57 -0500 | ||
4 | Subject: [PATCH 07/14] RH: trigger change uevent on new device creation | ||
5 | |||
6 | When multipath first sees a path device with user_friendly names | ||
7 | enabled, it can't know if the device should be multipathed. This means | ||
8 | that it will not claim the device in udev. If the device is eventually | ||
9 | multipathed, multipath should trigger a change uevent to update the udev | ||
10 | database to claim the device. | ||
11 | |||
12 | This also reverts commit 64e27ec066a001012f44550f095c93443e91d845. | ||
13 | |||
14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
15 | --- | ||
16 | libmultipath/configure.c | 26 ++++++++++++++++++++++++-- | ||
17 | libmultipath/configure.h | 1 + | ||
18 | libmultipath/wwids.c | 4 ++-- | ||
19 | multipath/main.c | 2 +- | ||
20 | multipathd/main.c | 7 ++----- | ||
21 | 5 files changed, 30 insertions(+), 10 deletions(-) | ||
22 | |||
23 | diff --git a/libmultipath/configure.c b/libmultipath/configure.c | ||
24 | index bd090d9..843dd09 100644 | ||
25 | --- a/libmultipath/configure.c | ||
26 | +++ b/libmultipath/configure.c | ||
27 | @@ -422,6 +422,28 @@ trigger_udev_change(const struct multipath *mpp) | ||
28 | udev_device_unref(udd); | ||
29 | } | ||
30 | |||
31 | +void | ||
32 | +trigger_paths_udev_change(const struct multipath *mpp) | ||
33 | +{ | ||
34 | + struct pathgroup * pgp; | ||
35 | + struct path * pp; | ||
36 | + int i, j; | ||
37 | + | ||
38 | + if (!mpp || !mpp->pg) | ||
39 | + return; | ||
40 | + | ||
41 | + vector_foreach_slot (mpp->pg, pgp, i) { | ||
42 | + if (!pgp->paths) | ||
43 | + continue; | ||
44 | + vector_foreach_slot(pgp->paths, pp, j) { | ||
45 | + if (!pp->udev) | ||
46 | + continue; | ||
47 | + sysfs_attr_set_value(pp->udev, "uevent", "change", | ||
48 | + strlen("change")); | ||
49 | + } | ||
50 | + } | ||
51 | +} | ||
52 | + | ||
53 | static int | ||
54 | is_mpp_known_to_udev(const struct multipath *mpp) | ||
55 | { | ||
56 | @@ -802,8 +824,8 @@ int domap(struct multipath *mpp, char *params, int is_daemon) | ||
57 | * succeeded | ||
58 | */ | ||
59 | mpp->force_udev_reload = 0; | ||
60 | - if (mpp->action == ACT_CREATE) | ||
61 | - remember_wwid(mpp->wwid); | ||
62 | + if (mpp->action == ACT_CREATE && remember_wwid(mpp->wwid) == 1) | ||
63 | + trigger_paths_udev_change(mpp); | ||
64 | if (!is_daemon) { | ||
65 | /* multipath client mode */ | ||
66 | dm_switchgroup(mpp->alias, mpp->bestpg); | ||
67 | diff --git a/libmultipath/configure.h b/libmultipath/configure.h | ||
68 | index fd7f581..253e29b 100644 | ||
69 | --- a/libmultipath/configure.h | ||
70 | +++ b/libmultipath/configure.h | ||
71 | @@ -36,3 +36,4 @@ int get_refwwid (enum mpath_cmds cmd, char * dev, enum devtypes dev_type, | ||
72 | vector pathvec, char **wwid); | ||
73 | int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh, int is_daemon); | ||
74 | int sysfs_get_host_adapter_name(struct path *pp, char *adapter_name); | ||
75 | +void trigger_paths_udev_change(const struct multipath *mpp); | ||
76 | diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c | ||
77 | index 88bb72b..249c6c1 100644 | ||
78 | --- a/libmultipath/wwids.c | ||
79 | +++ b/libmultipath/wwids.c | ||
80 | @@ -319,7 +319,7 @@ remember_wwid(char *wwid) | ||
81 | condlog(3, "wrote wwid %s to wwids file", wwid); | ||
82 | else | ||
83 | condlog(4, "wwid %s already in wwids file", wwid); | ||
84 | - return 0; | ||
85 | + return ret; | ||
86 | } | ||
87 | |||
88 | int remember_cmdline_wwid(void) | ||
89 | @@ -353,7 +353,7 @@ int remember_cmdline_wwid(void) | ||
90 | next++; | ||
91 | } | ||
92 | if (strlen(ptr)) { | ||
93 | - if (remember_wwid(ptr) != 0) | ||
94 | + if (remember_wwid(ptr) < 0) | ||
95 | ret = -1; | ||
96 | } | ||
97 | else { | ||
98 | diff --git a/multipath/main.c b/multipath/main.c | ||
99 | index 72585b0..2eda6a3 100644 | ||
100 | --- a/multipath/main.c | ||
101 | +++ b/multipath/main.c | ||
102 | @@ -336,7 +336,7 @@ configure (struct config *conf, enum mpath_cmds cmd, | ||
103 | } | ||
104 | if (cmd == CMD_ADD_WWID) { | ||
105 | r = remember_wwid(refwwid); | ||
106 | - if (r == 0) | ||
107 | + if (r >= 0) | ||
108 | printf("wwid '%s' added\n", refwwid); | ||
109 | else | ||
110 | printf("failed adding '%s' to wwids file\n", | ||
111 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
112 | index 81c76ca..874bcce 100644 | ||
113 | --- a/multipathd/main.c | ||
114 | +++ b/multipathd/main.c | ||
115 | @@ -2093,7 +2093,8 @@ configure (struct vectors * vecs, int start_waiters) | ||
116 | |||
117 | sync_maps_state(mpvec); | ||
118 | vector_foreach_slot(mpvec, mpp, i){ | ||
119 | - remember_wwid(mpp->wwid); | ||
120 | + if (remember_wwid(mpp->wwid) == 1) | ||
121 | + trigger_paths_udev_change(mpp); | ||
122 | update_map_pr(mpp); | ||
123 | } | ||
124 | |||
125 | @@ -2175,10 +2176,6 @@ reconfigure (struct vectors * vecs) | ||
126 | conf->verbosity = verbosity; | ||
127 | if (bindings_read_only) | ||
128 | conf->bindings_read_only = bindings_read_only; | ||
129 | - if (conf->find_multipaths) { | ||
130 | - condlog(2, "find_multipaths is set: -n is implied"); | ||
131 | - ignore_new_devs = 1; | ||
132 | - } | ||
133 | if (ignore_new_devs) | ||
134 | conf->ignore_new_devs = ignore_new_devs; | ||
135 | uxsock_timeout = conf->uxsock_timeout; | ||
136 | -- | ||
137 | 2.8.1 | ||
138 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch b/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch new file mode 100644 index 0000000000..9e608e16ff --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Sun, 13 May 2018 00:39:41 +0200 | ||
4 | Subject: [PATCH] multipath-tools: add +x to doc-preclean.pl and split-man.pl | ||
5 | |||
6 | It is not strictly necessary, but it helps identify bin files. | ||
7 | |||
8 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
9 | Cc: DM ML <dm-devel@redhat.com> | ||
10 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | libdmmp/docs/doc-preclean.pl | 0 | ||
14 | libdmmp/docs/split-man.pl | 0 | ||
15 | 2 files changed, 0 insertions(+), 0 deletions(-) | ||
16 | mode change 100644 => 100755 libdmmp/docs/doc-preclean.pl | ||
17 | mode change 100644 => 100755 libdmmp/docs/split-man.pl | ||
18 | |||
19 | diff --git a/libdmmp/docs/doc-preclean.pl b/libdmmp/docs/doc-preclean.pl | ||
20 | old mode 100644 | ||
21 | new mode 100755 | ||
22 | diff --git a/libdmmp/docs/split-man.pl b/libdmmp/docs/split-man.pl | ||
23 | old mode 100644 | ||
24 | new mode 100755 | ||
25 | -- | ||
26 | 2.7.4 | ||
27 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0008-libmultipath-change-how-RADOS-checker-is-enabled.patch b/meta-oe/recipes-support/multipath-tools/files/0008-libmultipath-change-how-RADOS-checker-is-enabled.patch deleted file mode 100644 index f678809931..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0008-libmultipath-change-how-RADOS-checker-is-enabled.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | From 0be174dbedd861d7694b0c7799fe26be31eb32b0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Fri, 26 May 2017 17:52:57 -0500 | ||
4 | Subject: [PATCH 08/14] libmultipath: change how RADOS checker is enabled | ||
5 | |||
6 | Instead of making the user call "make", "make install" and "make clean" | ||
7 | with ENABLE_RADOS set correctly, have the makefile check if | ||
8 | /usr/include/rados/librados.h exists, just like it checks if specific | ||
9 | functions exist in a file. | ||
10 | |||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | Makefile.inc | 13 +++++++++++++ | ||
14 | libmultipath/checkers/Makefile | 3 ++- | ||
15 | 2 files changed, 15 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/Makefile.inc b/Makefile.inc | ||
18 | index 2591fa9..e084fd1 100644 | ||
19 | --- a/Makefile.inc | ||
20 | +++ b/Makefile.inc | ||
21 | @@ -109,5 +109,18 @@ check_func = \ | ||
22 | echo "$$found" \ | ||
23 | ) | ||
24 | |||
25 | +# Checker whether a file with name $1 exists | ||
26 | +check_file = $(shell \ | ||
27 | + if [ -f "$1" ]; then \ | ||
28 | + found=1; \ | ||
29 | + status="yes"; \ | ||
30 | + else \ | ||
31 | + found=0; \ | ||
32 | + status="no"; \ | ||
33 | + fi; \ | ||
34 | + echo 1>&2 "Checking if $1 exists ... $$status"; \ | ||
35 | + echo "$$found" \ | ||
36 | + ) | ||
37 | + | ||
38 | %.o: %.c | ||
39 | $(CC) $(CFLAGS) -c -o $@ $< | ||
40 | diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile | ||
41 | index 732ca9d..bce6b8b 100644 | ||
42 | --- a/libmultipath/checkers/Makefile | ||
43 | +++ b/libmultipath/checkers/Makefile | ||
44 | @@ -14,7 +14,8 @@ LIBS= \ | ||
45 | libcheckemc_clariion.so \ | ||
46 | libcheckhp_sw.so \ | ||
47 | libcheckrdac.so | ||
48 | -ifneq ($(ENABLE_RADOS),0) | ||
49 | + | ||
50 | +ifneq ($(call check_file,/usr/include/rados/librados.h),0) | ||
51 | LIBS += libcheckrbd.so | ||
52 | endif | ||
53 | |||
54 | -- | ||
55 | 2.8.1 | ||
56 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch b/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch new file mode 100644 index 0000000000..3752158704 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch | |||
@@ -0,0 +1,784 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Sun, 13 May 2018 00:39:42 +0200 | ||
4 | Subject: [PATCH] multipath-tools: refresh kernel-doc from kernel sources | ||
5 | |||
6 | Cc: Gris Ge <fge@redhat.com> | ||
7 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
8 | Cc: device-mapper development <dm-devel@redhat.com> | ||
9 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
11 | --- | ||
12 | libdmmp/docs/kernel-doc | 671 ++++++++++++++++++++++++++---------------------- | ||
13 | 1 file changed, 368 insertions(+), 303 deletions(-) | ||
14 | |||
15 | diff --git a/libdmmp/docs/kernel-doc b/libdmmp/docs/kernel-doc | ||
16 | index fee8952..0057d8e 100755 | ||
17 | --- a/libdmmp/docs/kernel-doc | ||
18 | +++ b/libdmmp/docs/kernel-doc | ||
19 | @@ -1,4 +1,5 @@ | ||
20 | #!/usr/bin/env perl | ||
21 | +# SPDX-License-Identifier: GPL-2.0 | ||
22 | |||
23 | use warnings; | ||
24 | use strict; | ||
25 | @@ -328,13 +329,15 @@ my $lineprefix=""; | ||
26 | use constant { | ||
27 | STATE_NORMAL => 0, # normal code | ||
28 | STATE_NAME => 1, # looking for function name | ||
29 | - STATE_FIELD => 2, # scanning field start | ||
30 | - STATE_PROTO => 3, # scanning prototype | ||
31 | - STATE_DOCBLOCK => 4, # documentation block | ||
32 | - STATE_INLINE => 5, # gathering documentation outside main block | ||
33 | + STATE_BODY_MAYBE => 2, # body - or maybe more description | ||
34 | + STATE_BODY => 3, # the body of the comment | ||
35 | + STATE_PROTO => 4, # scanning prototype | ||
36 | + STATE_DOCBLOCK => 5, # documentation block | ||
37 | + STATE_INLINE => 6, # gathering documentation outside main block | ||
38 | }; | ||
39 | my $state; | ||
40 | my $in_doc_sect; | ||
41 | +my $leading_space; | ||
42 | |||
43 | # Inline documentation state | ||
44 | use constant { | ||
45 | @@ -363,7 +366,7 @@ my $doc_sect = $doc_com . | ||
46 | my $doc_content = $doc_com_body . '(.*)'; | ||
47 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; | ||
48 | my $doc_inline_start = '^\s*/\*\*\s*$'; | ||
49 | -my $doc_inline_sect = '\s*\*\s*(@[\w\s]+):(.*)'; | ||
50 | +my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)'; | ||
51 | my $doc_inline_end = '^\s*\*/\s*$'; | ||
52 | my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$'; | ||
53 | my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; | ||
54 | @@ -553,10 +556,9 @@ sub output_highlight { | ||
55 | } | ||
56 | if ($line eq ""){ | ||
57 | if (! $output_preformatted) { | ||
58 | - print $lineprefix, local_unescape($blankline); | ||
59 | + print $lineprefix, $blankline; | ||
60 | } | ||
61 | } else { | ||
62 | - $line =~ s/\\\\\\/\&/g; | ||
63 | if ($output_mode eq "man" && substr($line, 0, 1) eq ".") { | ||
64 | print "\\&$line"; | ||
65 | } else { | ||
66 | @@ -747,17 +749,73 @@ sub output_blockhead_rst(%) { | ||
67 | } | ||
68 | } | ||
69 | |||
70 | -sub output_highlight_rst { | ||
71 | - my $contents = join "\n",@_; | ||
72 | - my $line; | ||
73 | - | ||
74 | - # undo the evil effects of xml_escape() earlier | ||
75 | - $contents = xml_unescape($contents); | ||
76 | - | ||
77 | +# | ||
78 | +# Apply the RST highlights to a sub-block of text. | ||
79 | +# | ||
80 | +sub highlight_block($) { | ||
81 | + # The dohighlight kludge requires the text be called $contents | ||
82 | + my $contents = shift; | ||
83 | eval $dohighlight; | ||
84 | die $@ if $@; | ||
85 | + return $contents; | ||
86 | +} | ||
87 | |||
88 | - foreach $line (split "\n", $contents) { | ||
89 | +# | ||
90 | +# Regexes used only here. | ||
91 | +# | ||
92 | +my $sphinx_literal = '^[^.].*::$'; | ||
93 | +my $sphinx_cblock = '^\.\.\ +code-block::'; | ||
94 | + | ||
95 | +sub output_highlight_rst { | ||
96 | + my $input = join "\n",@_; | ||
97 | + my $output = ""; | ||
98 | + my $line; | ||
99 | + my $in_literal = 0; | ||
100 | + my $litprefix; | ||
101 | + my $block = ""; | ||
102 | + | ||
103 | + foreach $line (split "\n",$input) { | ||
104 | + # | ||
105 | + # If we're in a literal block, see if we should drop out | ||
106 | + # of it. Otherwise pass the line straight through unmunged. | ||
107 | + # | ||
108 | + if ($in_literal) { | ||
109 | + if (! ($line =~ /^\s*$/)) { | ||
110 | + # | ||
111 | + # If this is the first non-blank line in a literal | ||
112 | + # block we need to figure out what the proper indent is. | ||
113 | + # | ||
114 | + if ($litprefix eq "") { | ||
115 | + $line =~ /^(\s*)/; | ||
116 | + $litprefix = '^' . $1; | ||
117 | + $output .= $line . "\n"; | ||
118 | + } elsif (! ($line =~ /$litprefix/)) { | ||
119 | + $in_literal = 0; | ||
120 | + } else { | ||
121 | + $output .= $line . "\n"; | ||
122 | + } | ||
123 | + } else { | ||
124 | + $output .= $line . "\n"; | ||
125 | + } | ||
126 | + } | ||
127 | + # | ||
128 | + # Not in a literal block (or just dropped out) | ||
129 | + # | ||
130 | + if (! $in_literal) { | ||
131 | + $block .= $line . "\n"; | ||
132 | + if (($line =~ /$sphinx_literal/) || ($line =~ /$sphinx_cblock/)) { | ||
133 | + $in_literal = 1; | ||
134 | + $litprefix = ""; | ||
135 | + $output .= highlight_block($block); | ||
136 | + $block = "" | ||
137 | + } | ||
138 | + } | ||
139 | + } | ||
140 | + | ||
141 | + if ($block) { | ||
142 | + $output .= highlight_block($block); | ||
143 | + } | ||
144 | + foreach $line (split "\n", $output) { | ||
145 | print $lineprefix . $line . "\n"; | ||
146 | } | ||
147 | } | ||
148 | @@ -1062,7 +1120,7 @@ sub dump_struct($$) { | ||
149 | # Handle bitmaps | ||
150 | $arg =~ s/:\s*\d+\s*//g; | ||
151 | # Handle arrays | ||
152 | - $arg =~ s/\[\S+\]//g; | ||
153 | + $arg =~ s/\[.*\]//g; | ||
154 | # The type may have multiple words, | ||
155 | # and multiple IDs can be defined, like: | ||
156 | # const struct foo, *bar, foobar | ||
157 | @@ -1422,8 +1480,6 @@ sub push_parameter($$$$) { | ||
158 | } | ||
159 | } | ||
160 | |||
161 | - $param = xml_escape($param); | ||
162 | - | ||
163 | # strip spaces from $param so that it is one continuous string | ||
164 | # on @parameterlist; | ||
165 | # this fixes a problem where check_sections() cannot find | ||
166 | @@ -1522,6 +1578,7 @@ sub dump_function($$) { | ||
167 | $prototype =~ s/__meminit +//; | ||
168 | $prototype =~ s/__must_check +//; | ||
169 | $prototype =~ s/__weak +//; | ||
170 | + $prototype =~ s/__sched +//; | ||
171 | my $define = $prototype =~ s/^#\s*define\s+//; #ak added | ||
172 | $prototype =~ s/__attribute__\s*\(\( | ||
173 | (?: | ||
174 | @@ -1748,47 +1805,6 @@ sub process_proto_type($$) { | ||
175 | } | ||
176 | } | ||
177 | |||
178 | -# xml_escape: replace <, >, and & in the text stream; | ||
179 | -# | ||
180 | -# however, formatting controls that are generated internally/locally in the | ||
181 | -# kernel-doc script are not escaped here; instead, they begin life like | ||
182 | -# $blankline_html (4 of '\' followed by a mnemonic + ':'), then these strings | ||
183 | -# are converted to their mnemonic-expected output, without the 4 * '\' & ':', | ||
184 | -# just before actual output; (this is done by local_unescape()) | ||
185 | -sub xml_escape($) { | ||
186 | - my $text = shift; | ||
187 | - if ($output_mode eq "man") { | ||
188 | - return $text; | ||
189 | - } | ||
190 | - $text =~ s/\&/\\\\\\amp;/g; | ||
191 | - $text =~ s/\</\\\\\\lt;/g; | ||
192 | - $text =~ s/\>/\\\\\\gt;/g; | ||
193 | - return $text; | ||
194 | -} | ||
195 | - | ||
196 | -# xml_unescape: reverse the effects of xml_escape | ||
197 | -sub xml_unescape($) { | ||
198 | - my $text = shift; | ||
199 | - if ($output_mode eq "man") { | ||
200 | - return $text; | ||
201 | - } | ||
202 | - $text =~ s/\\\\\\amp;/\&/g; | ||
203 | - $text =~ s/\\\\\\lt;/</g; | ||
204 | - $text =~ s/\\\\\\gt;/>/g; | ||
205 | - return $text; | ||
206 | -} | ||
207 | - | ||
208 | -# convert local escape strings to html | ||
209 | -# local escape strings look like: '\\\\menmonic:' (that's 4 backslashes) | ||
210 | -sub local_unescape($) { | ||
211 | - my $text = shift; | ||
212 | - if ($output_mode eq "man") { | ||
213 | - return $text; | ||
214 | - } | ||
215 | - $text =~ s/\\\\\\\\lt:/</g; | ||
216 | - $text =~ s/\\\\\\\\gt:/>/g; | ||
217 | - return $text; | ||
218 | -} | ||
219 | |||
220 | sub map_filename($) { | ||
221 | my $file; | ||
222 | @@ -1826,15 +1842,291 @@ sub process_export_file($) { | ||
223 | close(IN); | ||
224 | } | ||
225 | |||
226 | -sub process_file($) { | ||
227 | - my $file; | ||
228 | +# | ||
229 | +# Parsers for the various processing states. | ||
230 | +# | ||
231 | +# STATE_NORMAL: looking for the /** to begin everything. | ||
232 | +# | ||
233 | +sub process_normal() { | ||
234 | + if (/$doc_start/o) { | ||
235 | + $state = STATE_NAME; # next line is always the function name | ||
236 | + $in_doc_sect = 0; | ||
237 | + $declaration_start_line = $. + 1; | ||
238 | + } | ||
239 | +} | ||
240 | + | ||
241 | +# | ||
242 | +# STATE_NAME: Looking for the "name - description" line | ||
243 | +# | ||
244 | +sub process_name($$) { | ||
245 | + my $file = shift; | ||
246 | my $identifier; | ||
247 | - my $func; | ||
248 | my $descr; | ||
249 | - my $in_purpose = 0; | ||
250 | + | ||
251 | + if (/$doc_block/o) { | ||
252 | + $state = STATE_DOCBLOCK; | ||
253 | + $contents = ""; | ||
254 | + $new_start_line = $. + 1; | ||
255 | + | ||
256 | + if ( $1 eq "" ) { | ||
257 | + $section = $section_intro; | ||
258 | + } else { | ||
259 | + $section = $1; | ||
260 | + } | ||
261 | + } | ||
262 | + elsif (/$doc_decl/o) { | ||
263 | + $identifier = $1; | ||
264 | + if (/\s*([\w\s]+?)(\(\))?\s*-/) { | ||
265 | + $identifier = $1; | ||
266 | + } | ||
267 | + | ||
268 | + $state = STATE_BODY; | ||
269 | + # if there's no @param blocks need to set up default section | ||
270 | + # here | ||
271 | + $contents = ""; | ||
272 | + $section = $section_default; | ||
273 | + $new_start_line = $. + 1; | ||
274 | + if (/-(.*)/) { | ||
275 | + # strip leading/trailing/multiple spaces | ||
276 | + $descr= $1; | ||
277 | + $descr =~ s/^\s*//; | ||
278 | + $descr =~ s/\s*$//; | ||
279 | + $descr =~ s/\s+/ /g; | ||
280 | + $declaration_purpose = $descr; | ||
281 | + $state = STATE_BODY_MAYBE; | ||
282 | + } else { | ||
283 | + $declaration_purpose = ""; | ||
284 | + } | ||
285 | + | ||
286 | + if (($declaration_purpose eq "") && $verbose) { | ||
287 | + print STDERR "${file}:$.: warning: missing initial short description on line:\n"; | ||
288 | + print STDERR $_; | ||
289 | + ++$warnings; | ||
290 | + } | ||
291 | + | ||
292 | + if ($identifier =~ m/^struct/) { | ||
293 | + $decl_type = 'struct'; | ||
294 | + } elsif ($identifier =~ m/^union/) { | ||
295 | + $decl_type = 'union'; | ||
296 | + } elsif ($identifier =~ m/^enum/) { | ||
297 | + $decl_type = 'enum'; | ||
298 | + } elsif ($identifier =~ m/^typedef/) { | ||
299 | + $decl_type = 'typedef'; | ||
300 | + } else { | ||
301 | + $decl_type = 'function'; | ||
302 | + } | ||
303 | + | ||
304 | + if ($verbose) { | ||
305 | + print STDERR "${file}:$.: info: Scanning doc for $identifier\n"; | ||
306 | + } | ||
307 | + } else { | ||
308 | + print STDERR "${file}:$.: warning: Cannot understand $_ on line $.", | ||
309 | + " - I thought it was a doc line\n"; | ||
310 | + ++$warnings; | ||
311 | + $state = STATE_NORMAL; | ||
312 | + } | ||
313 | +} | ||
314 | + | ||
315 | + | ||
316 | +# | ||
317 | +# STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment. | ||
318 | +# | ||
319 | +sub process_body($$) { | ||
320 | + my $file = shift; | ||
321 | + | ||
322 | + if (/$doc_sect/i) { # case insensitive for supported section names | ||
323 | + $newsection = $1; | ||
324 | + $newcontents = $2; | ||
325 | + | ||
326 | + # map the supported section names to the canonical names | ||
327 | + if ($newsection =~ m/^description$/i) { | ||
328 | + $newsection = $section_default; | ||
329 | + } elsif ($newsection =~ m/^context$/i) { | ||
330 | + $newsection = $section_context; | ||
331 | + } elsif ($newsection =~ m/^returns?$/i) { | ||
332 | + $newsection = $section_return; | ||
333 | + } elsif ($newsection =~ m/^\@return$/) { | ||
334 | + # special: @return is a section, not a param description | ||
335 | + $newsection = $section_return; | ||
336 | + } | ||
337 | + | ||
338 | + if (($contents ne "") && ($contents ne "\n")) { | ||
339 | + if (!$in_doc_sect && $verbose) { | ||
340 | + print STDERR "${file}:$.: warning: contents before sections\n"; | ||
341 | + ++$warnings; | ||
342 | + } | ||
343 | + dump_section($file, $section, $contents); | ||
344 | + $section = $section_default; | ||
345 | + } | ||
346 | + | ||
347 | + $in_doc_sect = 1; | ||
348 | + $state = STATE_BODY; | ||
349 | + $contents = $newcontents; | ||
350 | + $new_start_line = $.; | ||
351 | + while (substr($contents, 0, 1) eq " ") { | ||
352 | + $contents = substr($contents, 1); | ||
353 | + } | ||
354 | + if ($contents ne "") { | ||
355 | + $contents .= "\n"; | ||
356 | + } | ||
357 | + $section = $newsection; | ||
358 | + $leading_space = undef; | ||
359 | + } elsif (/$doc_end/) { | ||
360 | + if (($contents ne "") && ($contents ne "\n")) { | ||
361 | + dump_section($file, $section, $contents); | ||
362 | + $section = $section_default; | ||
363 | + $contents = ""; | ||
364 | + } | ||
365 | + # look for doc_com + <text> + doc_end: | ||
366 | + if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { | ||
367 | + print STDERR "${file}:$.: warning: suspicious ending line: $_"; | ||
368 | + ++$warnings; | ||
369 | + } | ||
370 | + | ||
371 | + $prototype = ""; | ||
372 | + $state = STATE_PROTO; | ||
373 | + $brcount = 0; | ||
374 | + } elsif (/$doc_content/) { | ||
375 | + # miguel-style comment kludge, look for blank lines after | ||
376 | + # @parameter line to signify start of description | ||
377 | + if ($1 eq "") { | ||
378 | + if ($section =~ m/^@/ || $section eq $section_context) { | ||
379 | + dump_section($file, $section, $contents); | ||
380 | + $section = $section_default; | ||
381 | + $contents = ""; | ||
382 | + $new_start_line = $.; | ||
383 | + } else { | ||
384 | + $contents .= "\n"; | ||
385 | + } | ||
386 | + $state = STATE_BODY; | ||
387 | + } elsif ($state == STATE_BODY_MAYBE) { | ||
388 | + # Continued declaration purpose | ||
389 | + chomp($declaration_purpose); | ||
390 | + $declaration_purpose .= " " . $1; | ||
391 | + $declaration_purpose =~ s/\s+/ /g; | ||
392 | + } else { | ||
393 | + my $cont = $1; | ||
394 | + if ($section =~ m/^@/ || $section eq $section_context) { | ||
395 | + if (!defined $leading_space) { | ||
396 | + if ($cont =~ m/^(\s+)/) { | ||
397 | + $leading_space = $1; | ||
398 | + } else { | ||
399 | + $leading_space = ""; | ||
400 | + } | ||
401 | + } | ||
402 | + $cont =~ s/^$leading_space//; | ||
403 | + } | ||
404 | + $contents .= $cont . "\n"; | ||
405 | + } | ||
406 | + } else { | ||
407 | + # i dont know - bad line? ignore. | ||
408 | + print STDERR "${file}:$.: warning: bad line: $_"; | ||
409 | + ++$warnings; | ||
410 | + } | ||
411 | +} | ||
412 | + | ||
413 | + | ||
414 | +# | ||
415 | +# STATE_PROTO: reading a function/whatever prototype. | ||
416 | +# | ||
417 | +sub process_proto($$) { | ||
418 | + my $file = shift; | ||
419 | + | ||
420 | + if (/$doc_inline_oneline/) { | ||
421 | + $section = $1; | ||
422 | + $contents = $2; | ||
423 | + if ($contents ne "") { | ||
424 | + $contents .= "\n"; | ||
425 | + dump_section($file, $section, $contents); | ||
426 | + $section = $section_default; | ||
427 | + $contents = ""; | ||
428 | + } | ||
429 | + } elsif (/$doc_inline_start/) { | ||
430 | + $state = STATE_INLINE; | ||
431 | + $inline_doc_state = STATE_INLINE_NAME; | ||
432 | + } elsif ($decl_type eq 'function') { | ||
433 | + process_proto_function($_, $file); | ||
434 | + } else { | ||
435 | + process_proto_type($_, $file); | ||
436 | + } | ||
437 | +} | ||
438 | + | ||
439 | +# | ||
440 | +# STATE_DOCBLOCK: within a DOC: block. | ||
441 | +# | ||
442 | +sub process_docblock($$) { | ||
443 | + my $file = shift; | ||
444 | + | ||
445 | + if (/$doc_end/) { | ||
446 | + dump_doc_section($file, $section, $contents); | ||
447 | + $section = $section_default; | ||
448 | + $contents = ""; | ||
449 | + $function = ""; | ||
450 | + %parameterdescs = (); | ||
451 | + %parametertypes = (); | ||
452 | + @parameterlist = (); | ||
453 | + %sections = (); | ||
454 | + @sectionlist = (); | ||
455 | + $prototype = ""; | ||
456 | + $state = STATE_NORMAL; | ||
457 | + } elsif (/$doc_content/) { | ||
458 | + if ( $1 eq "" ) { | ||
459 | + $contents .= $blankline; | ||
460 | + } else { | ||
461 | + $contents .= $1 . "\n"; | ||
462 | + } | ||
463 | + } | ||
464 | +} | ||
465 | + | ||
466 | +# | ||
467 | +# STATE_INLINE: docbook comments within a prototype. | ||
468 | +# | ||
469 | +sub process_inline($$) { | ||
470 | + my $file = shift; | ||
471 | + | ||
472 | + # First line (state 1) needs to be a @parameter | ||
473 | + if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { | ||
474 | + $section = $1; | ||
475 | + $contents = $2; | ||
476 | + $new_start_line = $.; | ||
477 | + if ($contents ne "") { | ||
478 | + while (substr($contents, 0, 1) eq " ") { | ||
479 | + $contents = substr($contents, 1); | ||
480 | + } | ||
481 | + $contents .= "\n"; | ||
482 | + } | ||
483 | + $inline_doc_state = STATE_INLINE_TEXT; | ||
484 | + # Documentation block end */ | ||
485 | + } elsif (/$doc_inline_end/) { | ||
486 | + if (($contents ne "") && ($contents ne "\n")) { | ||
487 | + dump_section($file, $section, $contents); | ||
488 | + $section = $section_default; | ||
489 | + $contents = ""; | ||
490 | + } | ||
491 | + $state = STATE_PROTO; | ||
492 | + $inline_doc_state = STATE_INLINE_NA; | ||
493 | + # Regular text | ||
494 | + } elsif (/$doc_content/) { | ||
495 | + if ($inline_doc_state == STATE_INLINE_TEXT) { | ||
496 | + $contents .= $1 . "\n"; | ||
497 | + # nuke leading blank lines | ||
498 | + if ($contents =~ /^\s*$/) { | ||
499 | + $contents = ""; | ||
500 | + } | ||
501 | + } elsif ($inline_doc_state == STATE_INLINE_NAME) { | ||
502 | + $inline_doc_state = STATE_INLINE_ERROR; | ||
503 | + print STDERR "${file}:$.: warning: "; | ||
504 | + print STDERR "Incorrect use of kernel-doc format: $_"; | ||
505 | + ++$warnings; | ||
506 | + } | ||
507 | + } | ||
508 | +} | ||
509 | + | ||
510 | + | ||
511 | +sub process_file($) { | ||
512 | + my $file; | ||
513 | my $initial_section_counter = $section_counter; | ||
514 | my ($orig_file) = @_; | ||
515 | - my $leading_space; | ||
516 | |||
517 | $file = map_filename($orig_file); | ||
518 | |||
519 | @@ -1853,250 +2145,23 @@ sub process_file($) { | ||
520 | } | ||
521 | # Replace tabs by spaces | ||
522 | while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; | ||
523 | + # Hand this line to the appropriate state handler | ||
524 | if ($state == STATE_NORMAL) { | ||
525 | - if (/$doc_start/o) { | ||
526 | - $state = STATE_NAME; # next line is always the function name | ||
527 | - $in_doc_sect = 0; | ||
528 | - $declaration_start_line = $. + 1; | ||
529 | - } | ||
530 | - } elsif ($state == STATE_NAME) {# this line is the function name (always) | ||
531 | - if (/$doc_block/o) { | ||
532 | - $state = STATE_DOCBLOCK; | ||
533 | - $contents = ""; | ||
534 | - $new_start_line = $. + 1; | ||
535 | - | ||
536 | - if ( $1 eq "" ) { | ||
537 | - $section = $section_intro; | ||
538 | - } else { | ||
539 | - $section = $1; | ||
540 | - } | ||
541 | - } | ||
542 | - elsif (/$doc_decl/o) { | ||
543 | - $identifier = $1; | ||
544 | - if (/\s*([\w\s]+?)\s*-/) { | ||
545 | - $identifier = $1; | ||
546 | - } | ||
547 | - | ||
548 | - $state = STATE_FIELD; | ||
549 | - # if there's no @param blocks need to set up default section | ||
550 | - # here | ||
551 | - $contents = ""; | ||
552 | - $section = $section_default; | ||
553 | - $new_start_line = $. + 1; | ||
554 | - if (/-(.*)/) { | ||
555 | - # strip leading/trailing/multiple spaces | ||
556 | - $descr= $1; | ||
557 | - $descr =~ s/^\s*//; | ||
558 | - $descr =~ s/\s*$//; | ||
559 | - $descr =~ s/\s+/ /g; | ||
560 | - $declaration_purpose = xml_escape($descr); | ||
561 | - $in_purpose = 1; | ||
562 | - } else { | ||
563 | - $declaration_purpose = ""; | ||
564 | - } | ||
565 | - | ||
566 | - if (($declaration_purpose eq "") && $verbose) { | ||
567 | - print STDERR "${file}:$.: warning: missing initial short description on line:\n"; | ||
568 | - print STDERR $_; | ||
569 | - ++$warnings; | ||
570 | - } | ||
571 | - | ||
572 | - if ($identifier =~ m/^struct/) { | ||
573 | - $decl_type = 'struct'; | ||
574 | - } elsif ($identifier =~ m/^union/) { | ||
575 | - $decl_type = 'union'; | ||
576 | - } elsif ($identifier =~ m/^enum/) { | ||
577 | - $decl_type = 'enum'; | ||
578 | - } elsif ($identifier =~ m/^typedef/) { | ||
579 | - $decl_type = 'typedef'; | ||
580 | - } else { | ||
581 | - $decl_type = 'function'; | ||
582 | - } | ||
583 | - | ||
584 | - if ($verbose) { | ||
585 | - print STDERR "${file}:$.: info: Scanning doc for $identifier\n"; | ||
586 | - } | ||
587 | - } else { | ||
588 | - print STDERR "${file}:$.: warning: Cannot understand $_ on line $.", | ||
589 | - " - I thought it was a doc line\n"; | ||
590 | - ++$warnings; | ||
591 | - $state = STATE_NORMAL; | ||
592 | - } | ||
593 | - } elsif ($state == STATE_FIELD) { # look for head: lines, and include content | ||
594 | - if (/$doc_sect/i) { # case insensitive for supported section names | ||
595 | - $newsection = $1; | ||
596 | - $newcontents = $2; | ||
597 | - | ||
598 | - # map the supported section names to the canonical names | ||
599 | - if ($newsection =~ m/^description$/i) { | ||
600 | - $newsection = $section_default; | ||
601 | - } elsif ($newsection =~ m/^context$/i) { | ||
602 | - $newsection = $section_context; | ||
603 | - } elsif ($newsection =~ m/^returns?$/i) { | ||
604 | - $newsection = $section_return; | ||
605 | - } elsif ($newsection =~ m/^\@return$/) { | ||
606 | - # special: @return is a section, not a param description | ||
607 | - $newsection = $section_return; | ||
608 | - } | ||
609 | - | ||
610 | - if (($contents ne "") && ($contents ne "\n")) { | ||
611 | - if (!$in_doc_sect && $verbose) { | ||
612 | - print STDERR "${file}:$.: warning: contents before sections\n"; | ||
613 | - ++$warnings; | ||
614 | - } | ||
615 | - dump_section($file, $section, xml_escape($contents)); | ||
616 | - $section = $section_default; | ||
617 | - } | ||
618 | - | ||
619 | - $in_doc_sect = 1; | ||
620 | - $in_purpose = 0; | ||
621 | - $contents = $newcontents; | ||
622 | - $new_start_line = $.; | ||
623 | - while (substr($contents, 0, 1) eq " ") { | ||
624 | - $contents = substr($contents, 1); | ||
625 | - } | ||
626 | - if ($contents ne "") { | ||
627 | - $contents .= "\n"; | ||
628 | - } | ||
629 | - $section = $newsection; | ||
630 | - $leading_space = undef; | ||
631 | - } elsif (/$doc_end/) { | ||
632 | - if (($contents ne "") && ($contents ne "\n")) { | ||
633 | - dump_section($file, $section, xml_escape($contents)); | ||
634 | - $section = $section_default; | ||
635 | - $contents = ""; | ||
636 | - } | ||
637 | - # look for doc_com + <text> + doc_end: | ||
638 | - if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { | ||
639 | - print STDERR "${file}:$.: warning: suspicious ending line: $_"; | ||
640 | - ++$warnings; | ||
641 | - } | ||
642 | - | ||
643 | - $prototype = ""; | ||
644 | - $state = STATE_PROTO; | ||
645 | - $brcount = 0; | ||
646 | -# print STDERR "end of doc comment, looking for prototype\n"; | ||
647 | - } elsif (/$doc_content/) { | ||
648 | - # miguel-style comment kludge, look for blank lines after | ||
649 | - # @parameter line to signify start of description | ||
650 | - if ($1 eq "") { | ||
651 | - if ($section =~ m/^@/ || $section eq $section_context) { | ||
652 | - dump_section($file, $section, xml_escape($contents)); | ||
653 | - $section = $section_default; | ||
654 | - $contents = ""; | ||
655 | - $new_start_line = $.; | ||
656 | - } else { | ||
657 | - $contents .= "\n"; | ||
658 | - } | ||
659 | - $in_purpose = 0; | ||
660 | - } elsif ($in_purpose == 1) { | ||
661 | - # Continued declaration purpose | ||
662 | - chomp($declaration_purpose); | ||
663 | - $declaration_purpose .= " " . xml_escape($1); | ||
664 | - $declaration_purpose =~ s/\s+/ /g; | ||
665 | - } else { | ||
666 | - my $cont = $1; | ||
667 | - if ($section =~ m/^@/ || $section eq $section_context) { | ||
668 | - if (!defined $leading_space) { | ||
669 | - if ($cont =~ m/^(\s+)/) { | ||
670 | - $leading_space = $1; | ||
671 | - } else { | ||
672 | - $leading_space = ""; | ||
673 | - } | ||
674 | - } | ||
675 | - | ||
676 | - $cont =~ s/^$leading_space//; | ||
677 | - } | ||
678 | - $contents .= $cont . "\n"; | ||
679 | - } | ||
680 | - } else { | ||
681 | - # i dont know - bad line? ignore. | ||
682 | - print STDERR "${file}:$.: warning: bad line: $_"; | ||
683 | - ++$warnings; | ||
684 | - } | ||
685 | + process_normal(); | ||
686 | + } elsif ($state == STATE_NAME) { | ||
687 | + process_name($file, $_); | ||
688 | + } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { | ||
689 | + process_body($file, $_); | ||
690 | } elsif ($state == STATE_INLINE) { # scanning for inline parameters | ||
691 | - # First line (state 1) needs to be a @parameter | ||
692 | - if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { | ||
693 | - $section = $1; | ||
694 | - $contents = $2; | ||
695 | - $new_start_line = $.; | ||
696 | - if ($contents ne "") { | ||
697 | - while (substr($contents, 0, 1) eq " ") { | ||
698 | - $contents = substr($contents, 1); | ||
699 | - } | ||
700 | - $contents .= "\n"; | ||
701 | - } | ||
702 | - $inline_doc_state = STATE_INLINE_TEXT; | ||
703 | - # Documentation block end */ | ||
704 | - } elsif (/$doc_inline_end/) { | ||
705 | - if (($contents ne "") && ($contents ne "\n")) { | ||
706 | - dump_section($file, $section, xml_escape($contents)); | ||
707 | - $section = $section_default; | ||
708 | - $contents = ""; | ||
709 | - } | ||
710 | - $state = STATE_PROTO; | ||
711 | - $inline_doc_state = STATE_INLINE_NA; | ||
712 | - # Regular text | ||
713 | - } elsif (/$doc_content/) { | ||
714 | - if ($inline_doc_state == STATE_INLINE_TEXT) { | ||
715 | - $contents .= $1 . "\n"; | ||
716 | - # nuke leading blank lines | ||
717 | - if ($contents =~ /^\s*$/) { | ||
718 | - $contents = ""; | ||
719 | - } | ||
720 | - } elsif ($inline_doc_state == STATE_INLINE_NAME) { | ||
721 | - $inline_doc_state = STATE_INLINE_ERROR; | ||
722 | - print STDERR "${file}:$.: warning: "; | ||
723 | - print STDERR "Incorrect use of kernel-doc format: $_"; | ||
724 | - ++$warnings; | ||
725 | - } | ||
726 | - } | ||
727 | - } elsif ($state == STATE_PROTO) { # scanning for function '{' (end of prototype) | ||
728 | - if (/$doc_inline_oneline/) { | ||
729 | - $section = $1; | ||
730 | - $contents = $2; | ||
731 | - if ($contents ne "") { | ||
732 | - $contents .= "\n"; | ||
733 | - dump_section($file, $section, xml_escape($contents)); | ||
734 | - $section = $section_default; | ||
735 | - $contents = ""; | ||
736 | - } | ||
737 | - } elsif (/$doc_inline_start/) { | ||
738 | - $state = STATE_INLINE; | ||
739 | - $inline_doc_state = STATE_INLINE_NAME; | ||
740 | - } elsif ($decl_type eq 'function') { | ||
741 | - process_proto_function($_, $file); | ||
742 | - } else { | ||
743 | - process_proto_type($_, $file); | ||
744 | - } | ||
745 | + process_inline($file, $_); | ||
746 | + } elsif ($state == STATE_PROTO) { | ||
747 | + process_proto($file, $_); | ||
748 | } elsif ($state == STATE_DOCBLOCK) { | ||
749 | - if (/$doc_end/) | ||
750 | - { | ||
751 | - dump_doc_section($file, $section, xml_escape($contents)); | ||
752 | - $section = $section_default; | ||
753 | - $contents = ""; | ||
754 | - $function = ""; | ||
755 | - %parameterdescs = (); | ||
756 | - %parametertypes = (); | ||
757 | - @parameterlist = (); | ||
758 | - %sections = (); | ||
759 | - @sectionlist = (); | ||
760 | - $prototype = ""; | ||
761 | - $state = STATE_NORMAL; | ||
762 | - } | ||
763 | - elsif (/$doc_content/) | ||
764 | - { | ||
765 | - if ( $1 eq "" ) | ||
766 | - { | ||
767 | - $contents .= $blankline; | ||
768 | - } | ||
769 | - else | ||
770 | - { | ||
771 | - $contents .= $1 . "\n"; | ||
772 | - } | ||
773 | - } | ||
774 | + process_docblock($file, $_); | ||
775 | } | ||
776 | } | ||
777 | + | ||
778 | + # Make sure we got something interesting. | ||
779 | if ($initial_section_counter == $section_counter) { | ||
780 | if ($output_mode ne "none") { | ||
781 | print STDERR "${file}:1: warning: no structured comments found\n"; | ||
782 | -- | ||
783 | 2.7.4 | ||
784 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0009-multipath-set-verbosity-to-default-during-config.patch b/meta-oe/recipes-support/multipath-tools/files/0009-multipath-set-verbosity-to-default-during-config.patch deleted file mode 100644 index 17d2d91796..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0009-multipath-set-verbosity-to-default-during-config.patch +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | From 526e539628e051128abf46a60ec22e18c9b5d84f Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Wed, 31 May 2017 15:03:02 -0500 | ||
4 | Subject: [PATCH 09/14] multipath: set verbosity to default during config | ||
5 | |||
6 | condlog was setting the verbosity to 0 if there was no configuration. | ||
7 | This keeps multipath from printing warning messages about config file | ||
8 | problems that are found while loading the configuration. Instead, it | ||
9 | should use the default config level until it loads the configuration | ||
10 | to find the current value. | ||
11 | |||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | libmultipath/debug.c | 3 ++- | ||
15 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/libmultipath/debug.c b/libmultipath/debug.c | ||
18 | index fbe171a..f89b264 100644 | ||
19 | --- a/libmultipath/debug.c | ||
20 | +++ b/libmultipath/debug.c | ||
21 | @@ -11,6 +11,7 @@ | ||
22 | #include "../third-party/valgrind/drd.h" | ||
23 | #include "vector.h" | ||
24 | #include "config.h" | ||
25 | +#include "defaults.h" | ||
26 | |||
27 | void dlog (int sink, int prio, const char * fmt, ...) | ||
28 | { | ||
29 | @@ -21,7 +22,7 @@ void dlog (int sink, int prio, const char * fmt, ...) | ||
30 | va_start(ap, fmt); | ||
31 | conf = get_multipath_config(); | ||
32 | ANNOTATE_IGNORE_READS_BEGIN(); | ||
33 | - thres = (conf) ? conf->verbosity : 0; | ||
34 | + thres = (conf) ? conf->verbosity : DEFAULT_VERBOSITY; | ||
35 | ANNOTATE_IGNORE_READS_END(); | ||
36 | put_multipath_config(conf); | ||
37 | |||
38 | -- | ||
39 | 2.8.1 | ||
40 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch b/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch new file mode 100644 index 0000000000..2cae0750ba --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
3 | Date: Mon, 14 May 2018 17:30:17 +0200 | ||
4 | Subject: [PATCH] multipath-tools: configure hitachi ams2000 and hus100 as full | ||
5 | active arrays | ||
6 | |||
7 | AMS2000 and HUS100 families are active/active arrays. | ||
8 | |||
9 | Based on https://support.hitachivantara.com/download/epcra/df818913.pdf | ||
10 | and internal hitachi docs. | ||
11 | |||
12 | Cc: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com> | ||
13 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
14 | Cc: DM-DEV ML <dm-devel@redhat.com> | ||
15 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
16 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
17 | --- | ||
18 | libmultipath/hwtable.c | 10 ++++++++-- | ||
19 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
22 | index 2ca6888..148f0ba 100644 | ||
23 | --- a/libmultipath/hwtable.c | ||
24 | +++ b/libmultipath/hwtable.c | ||
25 | @@ -398,13 +398,13 @@ static struct hwentry default_hw[] = { | ||
26 | * Mail : matthias.rudolph@hds.com | ||
27 | */ | ||
28 | { | ||
29 | - /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families */ | ||
30 | + /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families / HP XP */ | ||
31 | .vendor = "(HITACHI|HP)", | ||
32 | .product = "^OPEN-", | ||
33 | .pgpolicy = MULTIBUS, | ||
34 | }, | ||
35 | { | ||
36 | - /* AMS 2000 and HUS 100 families */ | ||
37 | + /* AMS other than AMS 2000 */ | ||
38 | .vendor = "HITACHI", | ||
39 | .product = "^DF", | ||
40 | .no_path_retry = NO_PATH_RETRY_QUEUE, | ||
41 | @@ -412,6 +412,12 @@ static struct hwentry default_hw[] = { | ||
42 | .pgfailback = -FAILBACK_IMMEDIATE, | ||
43 | .prio_name = PRIO_HDS, | ||
44 | }, | ||
45 | + { | ||
46 | + /* AMS 2000 and HUS 100 families */ | ||
47 | + .vendor = "HITACHI", | ||
48 | + .product = "^DF600F", | ||
49 | + .pgpolicy = MULTIBUS, | ||
50 | + }, | ||
51 | /* | ||
52 | * IBM | ||
53 | * | ||
54 | -- | ||
55 | 2.7.4 | ||
56 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch b/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch new file mode 100644 index 0000000000..2dda2edae5 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Wilck <mwilck@suse.com> | ||
3 | Date: Wed, 21 Mar 2018 10:34:18 +0100 | ||
4 | Subject: [PATCH] libmultipath: don't reject maps with undefined prio | ||
5 | |||
6 | libmultipath's prio routines can deal with pp->priority == PRIO_UNDEF | ||
7 | just fine. PRIO_UNDEF is just a very low priority. So there's | ||
8 | no reason to reject setting up a multipath map because paths have | ||
9 | undefined priority. | ||
10 | |||
11 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | libmultipath/configure.c | 5 ----- | ||
15 | 1 file changed, 5 deletions(-) | ||
16 | |||
17 | diff --git a/libmultipath/configure.c b/libmultipath/configure.c | ||
18 | index 5796683..5c54f9b 100644 | ||
19 | --- a/libmultipath/configure.c | ||
20 | +++ b/libmultipath/configure.c | ||
21 | @@ -1063,9 +1063,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, | ||
22 | continue; | ||
23 | } | ||
24 | |||
25 | - if (pp1->priority == PRIO_UNDEF) | ||
26 | - mpp->action = ACT_REJECT; | ||
27 | - | ||
28 | if (!mpp->paths) { | ||
29 | condlog(0, "%s: skip coalesce (no paths)", mpp->alias); | ||
30 | remove_map(mpp, vecs, 0); | ||
31 | @@ -1091,8 +1088,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, | ||
32 | mpp->size); | ||
33 | mpp->action = ACT_REJECT; | ||
34 | } | ||
35 | - if (pp2->priority == PRIO_UNDEF) | ||
36 | - mpp->action = ACT_REJECT; | ||
37 | } | ||
38 | verify_paths(mpp, vecs); | ||
39 | |||
40 | -- | ||
41 | 2.7.4 | ||
42 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0010-mpath-skip-device-configs-without-vendor-product.patch b/meta-oe/recipes-support/multipath-tools/files/0010-mpath-skip-device-configs-without-vendor-product.patch deleted file mode 100644 index 396b6d32e3..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0010-mpath-skip-device-configs-without-vendor-product.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From f88d60a93e98d86ae294f2317a122c4efde276f0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Wed, 31 May 2017 17:58:59 -0500 | ||
4 | Subject: [PATCH 10/14] mpath: skip device configs without vendor/product | ||
5 | |||
6 | Right now if multipath.conf includes a device configuration without a | ||
7 | vendor or product string, it will automatically be applied to all | ||
8 | devices, skipping all other configs entirely. This is clearly wrong. | ||
9 | This patch makes sure that user added configs include vendor and | ||
10 | product strings | ||
11 | |||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | libmultipath/config.c | 7 +++++++ | ||
15 | 1 file changed, 7 insertions(+) | ||
16 | |||
17 | diff --git a/libmultipath/config.c b/libmultipath/config.c | ||
18 | index c485748..bdde113 100644 | ||
19 | --- a/libmultipath/config.c | ||
20 | +++ b/libmultipath/config.c | ||
21 | @@ -452,6 +452,13 @@ restart: | ||
22 | break; | ||
23 | j = n; | ||
24 | vector_foreach_slot_after(hw, hwe2, j) { | ||
25 | + /* drop invalid device configs */ | ||
26 | + if (!hwe2->vendor || !hwe2->product) { | ||
27 | + condlog(0, "device config missing vendor or product parameter"); | ||
28 | + vector_del_slot(hw, j--); | ||
29 | + free_hwe(hwe2); | ||
30 | + continue; | ||
31 | + } | ||
32 | if (hwe_regmatch(hwe1, hwe2)) | ||
33 | continue; | ||
34 | /* dup */ | ||
35 | -- | ||
36 | 2.8.1 | ||
37 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-fix-show-maps-json-crash.patch b/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-fix-show-maps-json-crash.patch deleted file mode 100644 index 12d6d38a78..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-fix-show-maps-json-crash.patch +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | From bc3ceda747104afdc24386df5dc45ca86f6c2936 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Thu, 1 Jun 2017 17:52:28 -0500 | ||
4 | Subject: [PATCH 11/14] multipathd: fix "show maps json" crash | ||
5 | |||
6 | If there are no multipath devices, show_maps_json sets the maximum size | ||
7 | of the reply buffer to 0. Having a size of 0 causes the calls to calloc | ||
8 | and realloc to behave in ways that the code isn't designed to handle, | ||
9 | leading to a double-free crash. Instead, show_maps_json should just | ||
10 | use the INITIAL_REPLY_LEN if there are no multipath devices. | ||
11 | |||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | multipathd/cli_handlers.c | 6 ++++-- | ||
15 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c | ||
18 | index 04c7386..7b0d00c 100644 | ||
19 | --- a/multipathd/cli_handlers.c | ||
20 | +++ b/multipathd/cli_handlers.c | ||
21 | @@ -162,10 +162,12 @@ show_maps_json (char ** r, int * len, struct vectors * vecs) | ||
22 | struct multipath * mpp; | ||
23 | char * c; | ||
24 | char * reply; | ||
25 | - unsigned int maxlen = INITIAL_REPLY_LEN * | ||
26 | - PRINT_JSON_MULTIPLIER * VECTOR_SIZE(vecs->mpvec); | ||
27 | + unsigned int maxlen = INITIAL_REPLY_LEN; | ||
28 | int again = 1; | ||
29 | |||
30 | + if (VECTOR_SIZE(vecs->mpvec) > 0) | ||
31 | + maxlen *= PRINT_JSON_MULTIPLIER * VECTOR_SIZE(vecs->mpvec); | ||
32 | + | ||
33 | vector_foreach_slot(vecs->mpvec, mpp, i) { | ||
34 | if (update_multipath(vecs, mpp->alias, 0)) { | ||
35 | return 1; | ||
36 | -- | ||
37 | 2.8.1 | ||
38 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch b/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch new file mode 100644 index 0000000000..96a814ff8b --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Wilck <mwilck@suse.com> | ||
3 | Date: Wed, 21 Mar 2018 10:34:19 +0100 | ||
4 | Subject: [PATCH] multipathd: handle errors in uxlsnr as fatal | ||
5 | |||
6 | The ppoll() calls of the uxlsnr thread are vital for proper functioning of | ||
7 | multipathd. If the uxlsnr thread can't open the socket or fails to call ppoll() | ||
8 | for other reasons, quit the daemon. If we don't do that, multipathd may | ||
9 | hang in a state where it can't be terminated any more, because the uxlsnr | ||
10 | thread is responsible for handling all signals. This happens e.g. if | ||
11 | systemd's multipathd.socket is running in and multipathd is started from | ||
12 | outside systemd. | ||
13 | |||
14 | 24f2844 "multipathd: fix signal blocking logic" has made this problem more | ||
15 | severe. Before that patch, the signals weren't actually blocked in any thread. | ||
16 | That's not to say 24f2844 was wrong. I still think it's correct, we just | ||
17 | need this one on top. | ||
18 | |||
19 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
20 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
21 | --- | ||
22 | multipathd/uxlsnr.c | 5 +++-- | ||
23 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
24 | |||
25 | diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c | ||
26 | index cdafd82..6f66666 100644 | ||
27 | --- a/multipathd/uxlsnr.c | ||
28 | +++ b/multipathd/uxlsnr.c | ||
29 | @@ -178,7 +178,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
30 | |||
31 | if (ux_sock == -1) { | ||
32 | condlog(1, "could not create uxsock: %d", errno); | ||
33 | - return NULL; | ||
34 | + exit_daemon(); | ||
35 | } | ||
36 | |||
37 | pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock); | ||
38 | @@ -187,7 +187,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
39 | polls = (struct pollfd *)MALLOC((MIN_POLLS + 1) * sizeof(struct pollfd)); | ||
40 | if (!polls) { | ||
41 | condlog(0, "uxsock: failed to allocate poll fds"); | ||
42 | - return NULL; | ||
43 | + exit_daemon(); | ||
44 | } | ||
45 | sigfillset(&mask); | ||
46 | sigdelset(&mask, SIGINT); | ||
47 | @@ -249,6 +249,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
48 | |||
49 | /* something went badly wrong! */ | ||
50 | condlog(0, "uxsock: poll failed with %d", errno); | ||
51 | + exit_daemon(); | ||
52 | break; | ||
53 | } | ||
54 | |||
55 | -- | ||
56 | 2.7.4 | ||
57 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch b/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch new file mode 100644 index 0000000000..8ce2431d60 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Martin Wilck <mwilck@suse.com> | ||
3 | Date: Tue, 15 May 2018 14:32:44 +0200 | ||
4 | Subject: [PATCH] libmultipath: fix error parsing "find_multipaths strict" | ||
5 | |||
6 | If "find_multipaths strict" is set in multipath.conf, the error message | ||
7 | "illegal value for find_multipaths: strict" is printed. This causes no | ||
8 | functional problem, as "strict" happens to be the default, fallback | ||
9 | value. It should be fixed nonetheless. FIND_MULTIPATHS_STRICT, having | ||
10 | the highest numeric value, must be last in the enum. | ||
11 | |||
12 | Fixes: c36f2f42 "libmultipath: change find_multipaths option to multi-value" | ||
13 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
15 | --- | ||
16 | libmultipath/structs.h | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
20 | index eb6a178..e424b15 100644 | ||
21 | --- a/libmultipath/structs.h | ||
22 | +++ b/libmultipath/structs.h | ||
23 | @@ -122,9 +122,9 @@ enum find_multipaths_states { | ||
24 | FIND_MULTIPATHS_UNDEF = YNU_UNDEF, | ||
25 | FIND_MULTIPATHS_OFF = YNU_NO, | ||
26 | FIND_MULTIPATHS_ON = _FIND_MULTIPATHS_F, | ||
27 | - FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N, | ||
28 | FIND_MULTIPATHS_GREEDY = _FIND_MULTIPATHS_I, | ||
29 | FIND_MULTIPATHS_SMART = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_I, | ||
30 | + FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N, | ||
31 | __FIND_MULTIPATHS_LAST, | ||
32 | }; | ||
33 | |||
34 | -- | ||
35 | 2.7.4 | ||
36 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0012-multipath-tools-modify-Makefile.inc-for-cross-compil.patch b/meta-oe/recipes-support/multipath-tools/files/0012-multipath-tools-modify-Makefile.inc-for-cross-compil.patch deleted file mode 100644 index 5ccd4aed8b..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0012-multipath-tools-modify-Makefile.inc-for-cross-compil.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From 6864ba28dec61609662ce5dc8bc7ed1925abb546 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Wed, 5 Jul 2017 02:56:13 -0400 | ||
4 | Subject: [PATCH 12/14] multipath-tools: modify Makefile.inc for | ||
5 | cross-compilation | ||
6 | |||
7 | Do not look for systemd info on the host, and allow us to pass in CFLAGS | ||
8 | using the OPTFLAGS variable. | ||
9 | |||
10 | Upstream-Status: Inappropriate [embedded specific] | ||
11 | |||
12 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
13 | |||
14 | Update for version 0.5.0-144-g770e6d0 | ||
15 | |||
16 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
17 | |||
18 | Update for version 0.7.1 | ||
19 | |||
20 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
21 | --- | ||
22 | Makefile.inc | 8 ++------ | ||
23 | 1 file changed, 2 insertions(+), 6 deletions(-) | ||
24 | |||
25 | diff --git a/Makefile.inc b/Makefile.inc | ||
26 | index e084fd1..c7f45fa 100644 | ||
27 | --- a/Makefile.inc | ||
28 | +++ b/Makefile.inc | ||
29 | @@ -35,12 +35,6 @@ ifndef RUN | ||
30 | endif | ||
31 | endif | ||
32 | |||
33 | -ifndef SYSTEMD | ||
34 | - ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1) | ||
35 | - SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p') | ||
36 | - endif | ||
37 | -endif | ||
38 | - | ||
39 | ifndef SYSTEMDPATH | ||
40 | SYSTEMDPATH=usr/lib | ||
41 | endif | ||
42 | @@ -82,11 +76,13 @@ TEST_CC_OPTION = $(shell \ | ||
43 | |||
44 | STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) | ||
45 | |||
46 | +ifndef OPTFLAGS | ||
47 | OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ | ||
48 | -Werror=implicit-function-declaration -Werror=format-security \ | ||
49 | -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ | ||
50 | -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ | ||
51 | --param=ssp-buffer-size=4 | ||
52 | +endif | ||
53 | |||
54 | CFLAGS = $(OPTFLAGS) -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" | ||
55 | BIN_CFLAGS = -fPIE -DPIE | ||
56 | -- | ||
57 | 2.8.1 | ||
58 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch b/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch new file mode 100644 index 0000000000..c767804d1a --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Mon, 7 May 2018 17:16:05 -0500 | ||
4 | Subject: [PATCH] libmultipath: print correct default for delay_*_checks | ||
5 | |||
6 | These options default to "no", so they should display that when the | ||
7 | config is printed. | ||
8 | |||
9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
10 | --- | ||
11 | libmultipath/dict.c | 6 ++++-- | ||
12 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
15 | index 4040611..3e7c5d6 100644 | ||
16 | --- a/libmultipath/dict.c | ||
17 | +++ b/libmultipath/dict.c | ||
18 | @@ -1115,7 +1115,8 @@ print_off_int_undef(char * buff, int len, long v) | ||
19 | } | ||
20 | |||
21 | declare_def_handler(delay_watch_checks, set_off_int_undef) | ||
22 | -declare_def_snprint(delay_watch_checks, print_off_int_undef) | ||
23 | +declare_def_snprint_defint(delay_watch_checks, print_off_int_undef, | ||
24 | + DEFAULT_DELAY_CHECKS) | ||
25 | declare_ovr_handler(delay_watch_checks, set_off_int_undef) | ||
26 | declare_ovr_snprint(delay_watch_checks, print_off_int_undef) | ||
27 | declare_hw_handler(delay_watch_checks, set_off_int_undef) | ||
28 | @@ -1123,7 +1124,8 @@ declare_hw_snprint(delay_watch_checks, print_off_int_undef) | ||
29 | declare_mp_handler(delay_watch_checks, set_off_int_undef) | ||
30 | declare_mp_snprint(delay_watch_checks, print_off_int_undef) | ||
31 | declare_def_handler(delay_wait_checks, set_off_int_undef) | ||
32 | -declare_def_snprint(delay_wait_checks, print_off_int_undef) | ||
33 | +declare_def_snprint_defint(delay_wait_checks, print_off_int_undef, | ||
34 | + DEFAULT_DELAY_CHECKS) | ||
35 | declare_ovr_handler(delay_wait_checks, set_off_int_undef) | ||
36 | declare_ovr_snprint(delay_wait_checks, print_off_int_undef) | ||
37 | declare_hw_handler(delay_wait_checks, set_off_int_undef) | ||
38 | -- | ||
39 | 2.7.4 | ||
40 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch b/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch new file mode 100644 index 0000000000..0ab4e06733 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Wed, 9 May 2018 14:32:59 -0500 | ||
4 | Subject: [PATCH] multipath.conf.5: clarify property whitelist handling | ||
5 | |||
6 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
7 | --- | ||
8 | multipath/multipath.conf.5 | 7 +++---- | ||
9 | 1 file changed, 3 insertions(+), 4 deletions(-) | ||
10 | |||
11 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
12 | index f689795..96d1b66 100644 | ||
13 | --- a/multipath/multipath.conf.5 | ||
14 | +++ b/multipath/multipath.conf.5 | ||
15 | @@ -1181,10 +1181,9 @@ and | ||
16 | keywords. For a full description of these keywords please see the \fIdevices\fR | ||
17 | section description. | ||
18 | .LP | ||
19 | -The \fIproperty\fR blacklist and whitelist handling is different from the usual | ||
20 | -handling in the sense that the whitelist \fIhas\fR to be set, otherwise the | ||
21 | -device will be blacklisted. In these cases the message \fIblacklisted, udev | ||
22 | -property missing\fR will be displayed. | ||
23 | +The \fIproperty\fR whitelist handling is different from the usual | ||
24 | +handling in the sense that the device \fIhas\fR to have a udev property that | ||
25 | +matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed. | ||
26 | . | ||
27 | . | ||
28 | .\" ---------------------------------------------------------------------------- | ||
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch b/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch new file mode 100644 index 0000000000..be2681d70e --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch | |||
@@ -0,0 +1,317 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Thu, 31 May 2018 17:47:11 -0500 | ||
4 | Subject: [PATCH] mpathpersist: add all_tg_pt option | ||
5 | |||
6 | Some arrays, such as the EMC VNX, don't follow the scsi persistent | ||
7 | reservations spec in making key registrations per I_T NEXUS. Instead, | ||
8 | the registration is shared by all target ports connected to a given | ||
9 | host. This causes mpathpersist to fail whenever it tries to register a | ||
10 | key, since it will receive a registration conflict on some of the paths. | ||
11 | |||
12 | To deal with this, mpathpersist needs to track the hosts that it has | ||
13 | done a registration on, and only register once per host. The new | ||
14 | "all_tg_pt" multipath.conf option is used to set which arrays need this | ||
15 | feature. I currently don't know if all EMC VNX arrays handle persistent | ||
16 | reservations like this, or if it is configurable. A future patch will | ||
17 | update the VNX built-in config, if this is indeed their default (or | ||
18 | only) setting. | ||
19 | |||
20 | Multipathd doesn't need to worry about this. It is often the case that | ||
21 | when a path device comes back, it will still have the keys registered to | ||
22 | it. Because of this, multipathd uses register-and-ignore, which means | ||
23 | that it won't cause an error if the registration has already happened | ||
24 | down a different target port. | ||
25 | |||
26 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
27 | --- | ||
28 | libmpathpersist/mpath_persist.c | 28 ++++++++++++++++++++++------ | ||
29 | libmultipath/config.c | 2 ++ | ||
30 | libmultipath/config.h | 2 ++ | ||
31 | libmultipath/defaults.h | 1 + | ||
32 | libmultipath/dict.c | 10 ++++++++++ | ||
33 | libmultipath/propsel.c | 15 +++++++++++++++ | ||
34 | libmultipath/propsel.h | 1 + | ||
35 | libmultipath/structs.h | 7 +++++++ | ||
36 | multipath/multipath.conf.5 | 11 +++++++++++ | ||
37 | 9 files changed, 71 insertions(+), 6 deletions(-) | ||
38 | |||
39 | diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c | ||
40 | index 907a17c..ca91c55 100644 | ||
41 | --- a/libmpathpersist/mpath_persist.c | ||
42 | +++ b/libmpathpersist/mpath_persist.c | ||
43 | @@ -335,6 +335,7 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, | ||
44 | |||
45 | conf = get_multipath_config(); | ||
46 | select_reservation_key(conf, mpp); | ||
47 | + select_all_tg_pt(conf, mpp); | ||
48 | put_multipath_config(conf); | ||
49 | |||
50 | memcpy(&prkey, paramp->sa_key, 8); | ||
51 | @@ -456,7 +457,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
52 | unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy) | ||
53 | { | ||
54 | |||
55 | - int i, j; | ||
56 | + int i, j, k; | ||
57 | struct pathgroup *pgp = NULL; | ||
58 | struct path *pp = NULL; | ||
59 | int rollback = 0; | ||
60 | @@ -481,11 +482,13 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
61 | } | ||
62 | |||
63 | struct threadinfo thread[active_pathcount]; | ||
64 | + int hosts[active_pathcount]; | ||
65 | |||
66 | memset(thread, 0, sizeof(thread)); | ||
67 | |||
68 | /* init thread parameter */ | ||
69 | for (i =0; i< active_pathcount; i++){ | ||
70 | + hosts[i] = -1; | ||
71 | thread[i].param.rq_servact = rq_servact; | ||
72 | thread[i].param.rq_scope = rq_scope; | ||
73 | thread[i].param.rq_type = rq_type; | ||
74 | @@ -514,6 +517,17 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
75 | condlog (1, "%s: %s path not up. Skip.", mpp->wwid, pp->dev); | ||
76 | continue; | ||
77 | } | ||
78 | + if (mpp->all_tg_pt == ALL_TG_PT_ON && | ||
79 | + pp->sg_id.host_no != -1) { | ||
80 | + for (k = 0; k < count; k++) { | ||
81 | + if (pp->sg_id.host_no == hosts[k]) { | ||
82 | + condlog(3, "%s: %s host %d matches skip.", pp->wwid, pp->dev, pp->sg_id.host_no); | ||
83 | + break; | ||
84 | + } | ||
85 | + } | ||
86 | + if (k < count) | ||
87 | + continue; | ||
88 | + } | ||
89 | strncpy(thread[count].param.dev, pp->dev, | ||
90 | FILE_NAME_SIZE - 1); | ||
91 | |||
92 | @@ -531,10 +545,12 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
93 | condlog (0, "%s: failed to create thread %d", mpp->wwid, rc); | ||
94 | thread[count].param.status = MPATH_PR_THREAD_ERROR; | ||
95 | } | ||
96 | + else | ||
97 | + hosts[count] = pp->sg_id.host_no; | ||
98 | count = count + 1; | ||
99 | } | ||
100 | } | ||
101 | - for( i=0; i < active_pathcount ; i++){ | ||
102 | + for( i=0; i < count ; i++){ | ||
103 | if (thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
104 | rc = pthread_join(thread[i].id, NULL); | ||
105 | if (rc){ | ||
106 | @@ -557,7 +573,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
107 | } | ||
108 | if (rollback && ((rq_servact == MPATH_PROUT_REG_SA) && sa_key != 0 )){ | ||
109 | condlog (3, "%s: ERROR: initiating pr out rollback", mpp->wwid); | ||
110 | - for( i=0 ; i < active_pathcount ; i++){ | ||
111 | + for( i=0 ; i < count ; i++){ | ||
112 | if(thread[i].param.status == MPATH_PR_SUCCESS) { | ||
113 | memcpy(&thread[i].param.paramp->key, &thread[i].param.paramp->sa_key, 8); | ||
114 | memset(&thread[i].param.paramp->sa_key, 0, 8); | ||
115 | @@ -571,7 +587,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
116 | } else | ||
117 | thread[i].param.status = MPATH_PR_SKIP; | ||
118 | } | ||
119 | - for(i=0; i < active_pathcount ; i++){ | ||
120 | + for(i=0; i < count ; i++){ | ||
121 | if (thread[i].param.status != MPATH_PR_SKIP && | ||
122 | thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
123 | rc = pthread_join(thread[i].id, NULL); | ||
124 | @@ -720,7 +736,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope, | ||
125 | } | ||
126 | } | ||
127 | pthread_attr_destroy (&attr); | ||
128 | - for (i = 0; i < active_pathcount; i++){ | ||
129 | + for (i = 0; i < count; i++){ | ||
130 | if (thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
131 | rc = pthread_join (thread[i].id, NULL); | ||
132 | if (rc){ | ||
133 | @@ -729,7 +745,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope, | ||
134 | } | ||
135 | } | ||
136 | |||
137 | - for (i = 0; i < active_pathcount; i++){ | ||
138 | + for (i = 0; i < count; i++){ | ||
139 | /* check thread status here and return the status */ | ||
140 | |||
141 | if (thread[i].param.status == MPATH_PR_RESERV_CONFLICT) | ||
142 | diff --git a/libmultipath/config.c b/libmultipath/config.c | ||
143 | index 085a3e1..5872927 100644 | ||
144 | --- a/libmultipath/config.c | ||
145 | +++ b/libmultipath/config.c | ||
146 | @@ -352,6 +352,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src) | ||
147 | merge_num(skip_kpartx); | ||
148 | merge_num(max_sectors_kb); | ||
149 | merge_num(ghost_delay); | ||
150 | + merge_num(all_tg_pt); | ||
151 | |||
152 | snprintf(id, sizeof(id), "%s/%s", dst->vendor, dst->product); | ||
153 | reconcile_features_with_options(id, &dst->features, | ||
154 | @@ -622,6 +623,7 @@ load_config (char * file) | ||
155 | conf->disable_changed_wwids = DEFAULT_DISABLE_CHANGED_WWIDS; | ||
156 | conf->remove_retries = 0; | ||
157 | conf->ghost_delay = DEFAULT_GHOST_DELAY; | ||
158 | + conf->all_tg_pt = DEFAULT_ALL_TG_PT; | ||
159 | |||
160 | /* | ||
161 | * preload default hwtable | ||
162 | diff --git a/libmultipath/config.h b/libmultipath/config.h | ||
163 | index 6e69a37..1bf708a 100644 | ||
164 | --- a/libmultipath/config.h | ||
165 | +++ b/libmultipath/config.h | ||
166 | @@ -82,6 +82,7 @@ struct hwentry { | ||
167 | int skip_kpartx; | ||
168 | int max_sectors_kb; | ||
169 | int ghost_delay; | ||
170 | + int all_tg_pt; | ||
171 | char * bl_product; | ||
172 | }; | ||
173 | |||
174 | @@ -194,6 +195,7 @@ struct config { | ||
175 | char * partition_delim; | ||
176 | char * config_dir; | ||
177 | int prkey_source; | ||
178 | + int all_tg_pt; | ||
179 | struct be64 reservation_key; | ||
180 | |||
181 | vector keywords; | ||
182 | diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h | ||
183 | index d7b87b4..f076b4b 100644 | ||
184 | --- a/libmultipath/defaults.h | ||
185 | +++ b/libmultipath/defaults.h | ||
186 | @@ -43,6 +43,7 @@ | ||
187 | #define DEFAULT_GHOST_DELAY GHOST_DELAY_OFF | ||
188 | #define DEFAULT_FIND_MULTIPATHS_TIMEOUT -10 | ||
189 | #define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1 | ||
190 | +#define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF | ||
191 | |||
192 | #define DEFAULT_CHECKINT 5 | ||
193 | #define MAX_CHECKINT(a) (a << 2) | ||
194 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
195 | index 3e7c5d6..2557b8a 100644 | ||
196 | --- a/libmultipath/dict.c | ||
197 | +++ b/libmultipath/dict.c | ||
198 | @@ -1178,6 +1178,13 @@ declare_hw_snprint(ghost_delay, print_off_int_undef) | ||
199 | declare_mp_handler(ghost_delay, set_off_int_undef) | ||
200 | declare_mp_snprint(ghost_delay, print_off_int_undef) | ||
201 | |||
202 | +declare_def_handler(all_tg_pt, set_yes_no_undef) | ||
203 | +declare_def_snprint_defint(all_tg_pt, print_yes_no_undef, DEFAULT_ALL_TG_PT) | ||
204 | +declare_ovr_handler(all_tg_pt, set_yes_no_undef) | ||
205 | +declare_ovr_snprint(all_tg_pt, print_yes_no_undef) | ||
206 | +declare_hw_handler(all_tg_pt, set_yes_no_undef) | ||
207 | +declare_hw_snprint(all_tg_pt, print_yes_no_undef) | ||
208 | + | ||
209 | |||
210 | static int | ||
211 | def_uxsock_timeout_handler(struct config *conf, vector strvec) | ||
212 | @@ -1509,6 +1516,7 @@ init_keywords(vector keywords) | ||
213 | install_keyword("prkeys_file", &def_prkeys_file_handler, &snprint_def_prkeys_file); | ||
214 | install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err); | ||
215 | install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key); | ||
216 | + install_keyword("all_tg_pt", &def_all_tg_pt_handler, &snprint_def_all_tg_pt); | ||
217 | install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler); | ||
218 | install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); | ||
219 | install_keyword("detect_checker", &def_detect_checker_handler, &snprint_def_detect_checker); | ||
220 | @@ -1618,6 +1626,7 @@ init_keywords(vector keywords) | ||
221 | install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx); | ||
222 | install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb); | ||
223 | install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay); | ||
224 | + install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt); | ||
225 | install_sublevel_end(); | ||
226 | |||
227 | install_keyword_root("overrides", &overrides_handler); | ||
228 | @@ -1654,6 +1663,7 @@ init_keywords(vector keywords) | ||
229 | install_keyword("skip_kpartx", &ovr_skip_kpartx_handler, &snprint_ovr_skip_kpartx); | ||
230 | install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb); | ||
231 | install_keyword("ghost_delay", &ovr_ghost_delay_handler, &snprint_ovr_ghost_delay); | ||
232 | + install_keyword("all_tg_pt", &ovr_all_tg_pt_handler, &snprint_ovr_all_tg_pt); | ||
233 | |||
234 | install_keyword_root("multipaths", &multipaths_handler); | ||
235 | install_keyword_multi("multipath", &multipath_handler, NULL); | ||
236 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
237 | index 627d366..9ca1355 100644 | ||
238 | --- a/libmultipath/propsel.c | ||
239 | +++ b/libmultipath/propsel.c | ||
240 | @@ -978,3 +978,18 @@ out: | ||
241 | pp->dev, pp->find_multipaths_timeout, origin); | ||
242 | return 0; | ||
243 | } | ||
244 | + | ||
245 | +int select_all_tg_pt (struct config *conf, struct multipath * mp) | ||
246 | +{ | ||
247 | + const char *origin; | ||
248 | + | ||
249 | + mp_set_ovr(all_tg_pt); | ||
250 | + mp_set_hwe(all_tg_pt); | ||
251 | + mp_set_conf(all_tg_pt); | ||
252 | + mp_set_default(all_tg_pt, DEFAULT_ALL_TG_PT); | ||
253 | +out: | ||
254 | + condlog(3, "%s: all_tg_pt = %s %s", mp->alias, | ||
255 | + (mp->all_tg_pt == ALL_TG_PT_ON)? "yes" : "no", | ||
256 | + origin); | ||
257 | + return 0; | ||
258 | +} | ||
259 | diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h | ||
260 | index a022bee..ae99b92 100644 | ||
261 | --- a/libmultipath/propsel.h | ||
262 | +++ b/libmultipath/propsel.h | ||
263 | @@ -34,3 +34,4 @@ int select_ghost_delay(struct config *conf, struct multipath * mp); | ||
264 | void reconcile_features_with_options(const char *id, char **features, | ||
265 | int* no_path_retry, | ||
266 | int *retain_hwhandler); | ||
267 | +int select_all_tg_pt (struct config *conf, struct multipath * mp); | ||
268 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
269 | index e424b15..0194b1e 100644 | ||
270 | --- a/libmultipath/structs.h | ||
271 | +++ b/libmultipath/structs.h | ||
272 | @@ -217,6 +217,12 @@ enum prkey_sources { | ||
273 | PRKEY_SOURCE_FILE, | ||
274 | }; | ||
275 | |||
276 | +enum all_tg_pt_states { | ||
277 | + ALL_TG_PT_UNDEF = YNU_UNDEF, | ||
278 | + ALL_TG_PT_OFF = YNU_NO, | ||
279 | + ALL_TG_PT_ON = YNU_YES, | ||
280 | +}; | ||
281 | + | ||
282 | struct sg_id { | ||
283 | int host_no; | ||
284 | int channel; | ||
285 | @@ -362,6 +368,7 @@ struct multipath { | ||
286 | int prkey_source; | ||
287 | struct be64 reservation_key; | ||
288 | unsigned char prflag; | ||
289 | + int all_tg_pt; | ||
290 | struct gen_multipath generic_mp; | ||
291 | }; | ||
292 | |||
293 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
294 | index 96d1b66..0c1f174 100644 | ||
295 | --- a/multipath/multipath.conf.5 | ||
296 | +++ b/multipath/multipath.conf.5 | ||
297 | @@ -743,6 +743,17 @@ The default is: \fB<unset>\fR | ||
298 | . | ||
299 | . | ||
300 | .TP | ||
301 | +.B all_tg_pt | ||
302 | +This must be set to \fByes\fR to successfully use mpathpersist on arrays that | ||
303 | +automatically set and clear registration keys on all target ports from a | ||
304 | +host, instead of per target port per host. | ||
305 | +.RS | ||
306 | +.TP | ||
307 | +The default is: \fBno\fR | ||
308 | +.RE | ||
309 | +. | ||
310 | +. | ||
311 | +.TP | ||
312 | .B retain_attached_hw_handler | ||
313 | (Obsolete for kernels >= 4.3) If set to | ||
314 | .I yes | ||
315 | -- | ||
316 | 2.7.4 | ||
317 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch b/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch new file mode 100644 index 0000000000..8d1954725c --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch | |||
@@ -0,0 +1,1093 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Fri, 1 Jun 2018 16:30:44 -0500 | ||
4 | Subject: [PATCH] libmultipath: remove rbd code | ||
5 | |||
6 | The Ceph tean has asked to drop support for multipathed rbd, since it | ||
7 | was running into data corruption issues. There was never an upstream | ||
8 | Ceph release based on it, and because of the corruption, there should be | ||
9 | no users of this code. This patch simply reverts all the rbd code from | ||
10 | multipath. | ||
11 | |||
12 | Cc: Michael Christie <mchristi@redhat.com> | ||
13 | Cc: Jason Dillaman <dillaman@redhat.com> | ||
14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
15 | --- | ||
16 | libmultipath/checkers.c | 22 -- | ||
17 | libmultipath/checkers.h | 6 - | ||
18 | libmultipath/checkers/Makefile | 7 - | ||
19 | libmultipath/checkers/cciss_tur.c | 5 - | ||
20 | libmultipath/checkers/directio.c | 5 - | ||
21 | libmultipath/checkers/emc_clariion.c | 5 - | ||
22 | libmultipath/checkers/hp_sw.c | 5 - | ||
23 | libmultipath/checkers/rbd.c | 653 ----------------------------------- | ||
24 | libmultipath/checkers/rdac.c | 5 - | ||
25 | libmultipath/checkers/readsector0.c | 5 - | ||
26 | libmultipath/checkers/tur.c | 5 - | ||
27 | libmultipath/discovery.c | 70 ---- | ||
28 | libmultipath/hwtable.c | 12 - | ||
29 | multipath/multipath.conf.5 | 3 - | ||
30 | multipathd/main.c | 11 - | ||
31 | 15 files changed, 819 deletions(-) | ||
32 | delete mode 100644 libmultipath/checkers/rbd.c | ||
33 | |||
34 | diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c | ||
35 | index 08cdfc3..0bacc86 100644 | ||
36 | --- a/libmultipath/checkers.c | ||
37 | +++ b/libmultipath/checkers.c | ||
38 | @@ -141,13 +141,6 @@ struct checker * add_checker (char *multipath_dir, char * name) | ||
39 | if (!c->free) | ||
40 | goto out; | ||
41 | |||
42 | - c->repair = (void (*)(struct checker *)) dlsym(c->handle, | ||
43 | - "libcheck_repair"); | ||
44 | - errstr = dlerror(); | ||
45 | - if (errstr != NULL) | ||
46 | - condlog(0, "A dynamic linking error occurred: (%s)", errstr); | ||
47 | - if (!c->repair) | ||
48 | - goto out; | ||
49 | done: | ||
50 | c->fd = -1; | ||
51 | c->sync = 1; | ||
52 | @@ -222,20 +215,6 @@ void checker_put (struct checker * dst) | ||
53 | free_checker(src); | ||
54 | } | ||
55 | |||
56 | -void checker_repair (struct checker * c) | ||
57 | -{ | ||
58 | - if (!checker_selected(c)) | ||
59 | - return; | ||
60 | - | ||
61 | - c->message[0] = '\0'; | ||
62 | - if (c->disable) { | ||
63 | - MSG(c, "checker disabled"); | ||
64 | - return; | ||
65 | - } | ||
66 | - if (c->repair) | ||
67 | - c->repair(c); | ||
68 | -} | ||
69 | - | ||
70 | int checker_check (struct checker * c, int path_state) | ||
71 | { | ||
72 | int r; | ||
73 | @@ -310,7 +289,6 @@ void checker_get (char *multipath_dir, struct checker * dst, char * name) | ||
74 | dst->sync = src->sync; | ||
75 | strncpy(dst->name, src->name, CHECKER_NAME_LEN); | ||
76 | strncpy(dst->message, src->message, CHECKER_MSG_LEN); | ||
77 | - dst->repair = src->repair; | ||
78 | dst->check = src->check; | ||
79 | dst->init = src->init; | ||
80 | dst->free = src->free; | ||
81 | diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h | ||
82 | index 52154ca..7b18a1a 100644 | ||
83 | --- a/libmultipath/checkers.h | ||
84 | +++ b/libmultipath/checkers.h | ||
85 | @@ -86,7 +86,6 @@ enum path_check_state { | ||
86 | #define READSECTOR0 "readsector0" | ||
87 | #define CCISS_TUR "cciss_tur" | ||
88 | #define NONE "none" | ||
89 | -#define RBD "rbd" | ||
90 | |||
91 | #define ASYNC_TIMEOUT_SEC 30 | ||
92 | |||
93 | @@ -113,9 +112,6 @@ struct checker { | ||
94 | multipath-wide. Use MALLOC if | ||
95 | you want to stuff data in. */ | ||
96 | int (*check)(struct checker *); | ||
97 | - void (*repair)(struct checker *); /* called if check returns | ||
98 | - PATH_DOWN to bring path into | ||
99 | - usable state */ | ||
100 | int (*init)(struct checker *); /* to allocate the context */ | ||
101 | void (*free)(struct checker *); /* to free the context */ | ||
102 | }; | ||
103 | @@ -136,7 +132,6 @@ void checker_set_async (struct checker *); | ||
104 | void checker_set_fd (struct checker *, int); | ||
105 | void checker_enable (struct checker *); | ||
106 | void checker_disable (struct checker *); | ||
107 | -void checker_repair (struct checker *); | ||
108 | int checker_check (struct checker *, int); | ||
109 | int checker_selected (struct checker *); | ||
110 | char * checker_name (struct checker *); | ||
111 | @@ -148,6 +143,5 @@ void checker_get (char *, struct checker *, char *); | ||
112 | int libcheck_check(struct checker *); | ||
113 | int libcheck_init(struct checker *); | ||
114 | void libcheck_free(struct checker *); | ||
115 | -void libcheck_repair(struct checker *); | ||
116 | |||
117 | #endif /* _CHECKERS_H */ | ||
118 | diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile | ||
119 | index 87c15bd..02caea6 100644 | ||
120 | --- a/libmultipath/checkers/Makefile | ||
121 | +++ b/libmultipath/checkers/Makefile | ||
122 | @@ -15,15 +15,8 @@ LIBS= \ | ||
123 | libcheckhp_sw.so \ | ||
124 | libcheckrdac.so | ||
125 | |||
126 | -ifneq ($(call check_file,/usr/include/rados/librados.h),0) | ||
127 | -LIBS += libcheckrbd.so | ||
128 | -endif | ||
129 | - | ||
130 | all: $(LIBS) | ||
131 | |||
132 | -libcheckrbd.so: rbd.o | ||
133 | - $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lrados -ludev | ||
134 | - | ||
135 | libcheckdirectio.so: libsg.o directio.o | ||
136 | $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -laio | ||
137 | |||
138 | diff --git a/libmultipath/checkers/cciss_tur.c b/libmultipath/checkers/cciss_tur.c | ||
139 | index 436470c..1cab201 100644 | ||
140 | --- a/libmultipath/checkers/cciss_tur.c | ||
141 | +++ b/libmultipath/checkers/cciss_tur.c | ||
142 | @@ -59,11 +59,6 @@ void libcheck_free (struct checker * c) | ||
143 | return; | ||
144 | } | ||
145 | |||
146 | -void libcheck_repair (struct checker * c) | ||
147 | -{ | ||
148 | - return; | ||
149 | -} | ||
150 | - | ||
151 | int libcheck_check(struct checker * c) | ||
152 | { | ||
153 | int rc; | ||
154 | diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c | ||
155 | index ce60e4c..a80848d 100644 | ||
156 | --- a/libmultipath/checkers/directio.c | ||
157 | +++ b/libmultipath/checkers/directio.c | ||
158 | @@ -118,11 +118,6 @@ void libcheck_free (struct checker * c) | ||
159 | free(ct); | ||
160 | } | ||
161 | |||
162 | -void libcheck_repair (struct checker * c) | ||
163 | -{ | ||
164 | - return; | ||
165 | -} | ||
166 | - | ||
167 | static int | ||
168 | check_state(int fd, struct directio_context *ct, int sync, int timeout_secs) | ||
169 | { | ||
170 | diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c | ||
171 | index 9c1ffed..9115b1b 100644 | ||
172 | --- a/libmultipath/checkers/emc_clariion.c | ||
173 | +++ b/libmultipath/checkers/emc_clariion.c | ||
174 | @@ -90,11 +90,6 @@ void libcheck_free (struct checker * c) | ||
175 | free(c->context); | ||
176 | } | ||
177 | |||
178 | -void libcheck_repair (struct checker * c) | ||
179 | -{ | ||
180 | - return; | ||
181 | -} | ||
182 | - | ||
183 | int libcheck_check (struct checker * c) | ||
184 | { | ||
185 | unsigned char sense_buffer[128] = { 0, }; | ||
186 | diff --git a/libmultipath/checkers/hp_sw.c b/libmultipath/checkers/hp_sw.c | ||
187 | index cee9aab..0ad34a6 100644 | ||
188 | --- a/libmultipath/checkers/hp_sw.c | ||
189 | +++ b/libmultipath/checkers/hp_sw.c | ||
190 | @@ -45,11 +45,6 @@ void libcheck_free (struct checker * c) | ||
191 | return; | ||
192 | } | ||
193 | |||
194 | -void libcheck_repair (struct checker * c) | ||
195 | -{ | ||
196 | - return; | ||
197 | -} | ||
198 | - | ||
199 | static int | ||
200 | do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op, | ||
201 | void *resp, int mx_resp_len, int noisy, unsigned int timeout) | ||
202 | diff --git a/libmultipath/checkers/rbd.c b/libmultipath/checkers/rbd.c | ||
203 | deleted file mode 100644 | ||
204 | index 4ff54f4..0000000 | ||
205 | --- a/libmultipath/checkers/rbd.c | ||
206 | +++ /dev/null | ||
207 | @@ -1,653 +0,0 @@ | ||
208 | -/* | ||
209 | - * Copyright (c) 2016 Red Hat | ||
210 | - * Copyright (c) 2004 Christophe Varoqui | ||
211 | - * | ||
212 | - * Code based off of tur.c and ceph's krbd.cc | ||
213 | - */ | ||
214 | -#define _GNU_SOURCE | ||
215 | -#include <stdio.h> | ||
216 | -#include <stdlib.h> | ||
217 | -#include <string.h> | ||
218 | -#include <unistd.h> | ||
219 | -#include <fcntl.h> | ||
220 | -#include <errno.h> | ||
221 | -#include <pthread.h> | ||
222 | -#include <libudev.h> | ||
223 | -#include <ifaddrs.h> | ||
224 | -#include <sys/types.h> | ||
225 | -#include <sys/stat.h> | ||
226 | -#include <sys/ioctl.h> | ||
227 | -#include <sys/time.h> | ||
228 | -#include <sys/wait.h> | ||
229 | -#include <urcu.h> | ||
230 | - | ||
231 | -#include "rados/librados.h" | ||
232 | - | ||
233 | -#include "structs.h" | ||
234 | -#include "checkers.h" | ||
235 | - | ||
236 | -#include "../libmultipath/debug.h" | ||
237 | -#include "../libmultipath/util.h" | ||
238 | -#include "../libmultipath/time-util.h" | ||
239 | -#include "../libmultipath/util.h" | ||
240 | - | ||
241 | -struct rbd_checker_context; | ||
242 | -typedef int (thread_fn)(struct rbd_checker_context *ct, char *msg); | ||
243 | - | ||
244 | -#define RBD_MSG(msg, fmt, args...) snprintf(msg, CHECKER_MSG_LEN, fmt, ##args); | ||
245 | - | ||
246 | -#define RBD_FEATURE_EXCLUSIVE_LOCK (1 << 2) | ||
247 | - | ||
248 | -struct rbd_checker_context { | ||
249 | - int rbd_bus_id; | ||
250 | - char *client_addr; | ||
251 | - char *config_info; | ||
252 | - char *snap; | ||
253 | - char *pool; | ||
254 | - char *image; | ||
255 | - char *username; | ||
256 | - int remapped; | ||
257 | - int blacklisted; | ||
258 | - unsigned lock_on_read:1; | ||
259 | - | ||
260 | - rados_t cluster; | ||
261 | - | ||
262 | - int state; | ||
263 | - int running; | ||
264 | - time_t time; | ||
265 | - thread_fn *fn; | ||
266 | - pthread_t thread; | ||
267 | - pthread_mutex_t lock; | ||
268 | - pthread_cond_t active; | ||
269 | - pthread_spinlock_t hldr_lock; | ||
270 | - int holders; | ||
271 | - char message[CHECKER_MSG_LEN]; | ||
272 | -}; | ||
273 | - | ||
274 | -int libcheck_init(struct checker * c) | ||
275 | -{ | ||
276 | - struct rbd_checker_context *ct; | ||
277 | - struct udev_device *block_dev; | ||
278 | - struct udev_device *bus_dev; | ||
279 | - struct udev *udev; | ||
280 | - struct stat sb; | ||
281 | - const char *block_name, *addr, *config_info, *features_str; | ||
282 | - const char *image, *pool, *snap, *username; | ||
283 | - uint64_t features = 0; | ||
284 | - char sysfs_path[PATH_SIZE]; | ||
285 | - int ret; | ||
286 | - | ||
287 | - ct = malloc(sizeof(struct rbd_checker_context)); | ||
288 | - if (!ct) | ||
289 | - return 1; | ||
290 | - memset(ct, 0, sizeof(struct rbd_checker_context)); | ||
291 | - ct->holders = 1; | ||
292 | - pthread_cond_init_mono(&ct->active); | ||
293 | - pthread_mutex_init(&ct->lock, NULL); | ||
294 | - pthread_spin_init(&ct->hldr_lock, PTHREAD_PROCESS_PRIVATE); | ||
295 | - c->context = ct; | ||
296 | - | ||
297 | - /* | ||
298 | - * The rbd block layer sysfs device is not linked to the rbd bus | ||
299 | - * device that we interact with, so figure that out now. | ||
300 | - */ | ||
301 | - if (fstat(c->fd, &sb) != 0) | ||
302 | - goto free_ct; | ||
303 | - | ||
304 | - udev = udev_new(); | ||
305 | - if (!udev) | ||
306 | - goto free_ct; | ||
307 | - | ||
308 | - block_dev = udev_device_new_from_devnum(udev, 'b', sb.st_rdev); | ||
309 | - if (!block_dev) | ||
310 | - goto free_udev; | ||
311 | - | ||
312 | - block_name = udev_device_get_sysname(block_dev); | ||
313 | - ret = sscanf(block_name, "rbd%d", &ct->rbd_bus_id); | ||
314 | - | ||
315 | - udev_device_unref(block_dev); | ||
316 | - if (ret != 1) | ||
317 | - goto free_udev; | ||
318 | - | ||
319 | - snprintf(sysfs_path, sizeof(sysfs_path), "/sys/bus/rbd/devices/%d", | ||
320 | - ct->rbd_bus_id); | ||
321 | - bus_dev = udev_device_new_from_syspath(udev, sysfs_path); | ||
322 | - if (!bus_dev) | ||
323 | - goto free_udev; | ||
324 | - | ||
325 | - addr = udev_device_get_sysattr_value(bus_dev, "client_addr"); | ||
326 | - if (!addr) { | ||
327 | - condlog(0, "rbd%d: Could not find client_addr in rbd sysfs. " | ||
328 | - "Try updating kernel", ct->rbd_bus_id); | ||
329 | - goto free_dev; | ||
330 | - } | ||
331 | - | ||
332 | - ct->client_addr = strdup(addr); | ||
333 | - if (!ct->client_addr) | ||
334 | - goto free_dev; | ||
335 | - | ||
336 | - features_str = udev_device_get_sysattr_value(bus_dev, "features"); | ||
337 | - if (!features_str) | ||
338 | - goto free_addr; | ||
339 | - features = strtoll(features_str, NULL, 16); | ||
340 | - if (!(features & RBD_FEATURE_EXCLUSIVE_LOCK)) { | ||
341 | - condlog(3, "rbd%d: Exclusive lock not set.", ct->rbd_bus_id); | ||
342 | - goto free_addr; | ||
343 | - } | ||
344 | - | ||
345 | - config_info = udev_device_get_sysattr_value(bus_dev, "config_info"); | ||
346 | - if (!config_info) | ||
347 | - goto free_addr; | ||
348 | - | ||
349 | - if (!strstr(config_info, "noshare")) { | ||
350 | - condlog(3, "rbd%d: Only nonshared clients supported.", | ||
351 | - ct->rbd_bus_id); | ||
352 | - goto free_addr; | ||
353 | - } | ||
354 | - | ||
355 | - if (strstr(config_info, "lock_on_read")) | ||
356 | - ct->lock_on_read = 1; | ||
357 | - | ||
358 | - ct->config_info = strdup(config_info); | ||
359 | - if (!ct->config_info) | ||
360 | - goto free_addr; | ||
361 | - | ||
362 | - username = strstr(config_info, "name="); | ||
363 | - if (username) { | ||
364 | - char *end; | ||
365 | - int len; | ||
366 | - | ||
367 | - username += 5; | ||
368 | - end = strchr(username, ','); | ||
369 | - if (!end) | ||
370 | - goto free_info; | ||
371 | - len = end - username; | ||
372 | - | ||
373 | - ct->username = malloc(len + 1); | ||
374 | - if (!ct->username) | ||
375 | - goto free_info; | ||
376 | - strncpy(ct->username, username, len); | ||
377 | - ct->username[len] = '\0'; | ||
378 | - } | ||
379 | - | ||
380 | - image = udev_device_get_sysattr_value(bus_dev, "name"); | ||
381 | - if (!image) | ||
382 | - goto free_username; | ||
383 | - | ||
384 | - ct->image = strdup(image); | ||
385 | - if (!ct->image) | ||
386 | - goto free_username; | ||
387 | - | ||
388 | - pool = udev_device_get_sysattr_value(bus_dev, "pool"); | ||
389 | - if (!pool) | ||
390 | - goto free_image; | ||
391 | - | ||
392 | - ct->pool = strdup(pool); | ||
393 | - if (!ct->pool) | ||
394 | - goto free_image; | ||
395 | - | ||
396 | - snap = udev_device_get_sysattr_value(bus_dev, "current_snap"); | ||
397 | - if (!snap) | ||
398 | - goto free_pool; | ||
399 | - | ||
400 | - if (strcmp("-", snap)) { | ||
401 | - ct->snap = strdup(snap); | ||
402 | - if (!ct->snap) | ||
403 | - goto free_pool; | ||
404 | - } | ||
405 | - | ||
406 | - if (rados_create(&ct->cluster, NULL) < 0) { | ||
407 | - condlog(0, "rbd%d: Could not create rados cluster", | ||
408 | - ct->rbd_bus_id); | ||
409 | - goto free_snap; | ||
410 | - } | ||
411 | - | ||
412 | - if (rados_conf_read_file(ct->cluster, NULL) < 0) { | ||
413 | - condlog(0, "rbd%d: Could not read rados conf", ct->rbd_bus_id); | ||
414 | - goto shutdown_rados; | ||
415 | - } | ||
416 | - | ||
417 | - ret = rados_connect(ct->cluster); | ||
418 | - if (ret < 0) { | ||
419 | - condlog(0, "rbd%d: Could not connect to rados cluster", | ||
420 | - ct->rbd_bus_id); | ||
421 | - goto shutdown_rados; | ||
422 | - } | ||
423 | - | ||
424 | - udev_device_unref(bus_dev); | ||
425 | - udev_unref(udev); | ||
426 | - | ||
427 | - condlog(3, "rbd%d checker init %s %s/%s@%s %s", ct->rbd_bus_id, | ||
428 | - ct->client_addr, ct->pool, ct->image, ct->snap ? ct->snap : "-", | ||
429 | - ct->username ? ct->username : "none"); | ||
430 | - return 0; | ||
431 | - | ||
432 | -shutdown_rados: | ||
433 | - rados_shutdown(ct->cluster); | ||
434 | -free_snap: | ||
435 | - if (ct->snap) | ||
436 | - free(ct->snap); | ||
437 | -free_pool: | ||
438 | - free(ct->pool); | ||
439 | -free_image: | ||
440 | - free(ct->image); | ||
441 | -free_username: | ||
442 | - if (ct->username) | ||
443 | - free(ct->username); | ||
444 | -free_info: | ||
445 | - free(ct->config_info); | ||
446 | -free_addr: | ||
447 | - free(ct->client_addr); | ||
448 | -free_dev: | ||
449 | - udev_device_unref(bus_dev); | ||
450 | -free_udev: | ||
451 | - udev_unref(udev); | ||
452 | -free_ct: | ||
453 | - free(ct); | ||
454 | - return 1; | ||
455 | -} | ||
456 | - | ||
457 | -static void cleanup_context(struct rbd_checker_context *ct) | ||
458 | -{ | ||
459 | - pthread_mutex_destroy(&ct->lock); | ||
460 | - pthread_cond_destroy(&ct->active); | ||
461 | - pthread_spin_destroy(&ct->hldr_lock); | ||
462 | - | ||
463 | - rados_shutdown(ct->cluster); | ||
464 | - | ||
465 | - if (ct->username) | ||
466 | - free(ct->username); | ||
467 | - if (ct->snap) | ||
468 | - free(ct->snap); | ||
469 | - free(ct->pool); | ||
470 | - free(ct->image); | ||
471 | - free(ct->config_info); | ||
472 | - free(ct->client_addr); | ||
473 | - free(ct); | ||
474 | -} | ||
475 | - | ||
476 | -void libcheck_free(struct checker * c) | ||
477 | -{ | ||
478 | - if (c->context) { | ||
479 | - struct rbd_checker_context *ct = c->context; | ||
480 | - int holders; | ||
481 | - pthread_t thread; | ||
482 | - | ||
483 | - pthread_spin_lock(&ct->hldr_lock); | ||
484 | - ct->holders--; | ||
485 | - holders = ct->holders; | ||
486 | - thread = ct->thread; | ||
487 | - pthread_spin_unlock(&ct->hldr_lock); | ||
488 | - if (holders) | ||
489 | - pthread_cancel(thread); | ||
490 | - else | ||
491 | - cleanup_context(ct); | ||
492 | - c->context = NULL; | ||
493 | - } | ||
494 | -} | ||
495 | - | ||
496 | -static int rbd_is_blacklisted(struct rbd_checker_context *ct, char *msg) | ||
497 | -{ | ||
498 | - char *addr_tok, *start, *save; | ||
499 | - const char *cmd[2]; | ||
500 | - char *blklist, *stat; | ||
501 | - size_t blklist_len, stat_len; | ||
502 | - int ret; | ||
503 | - char *end; | ||
504 | - | ||
505 | - cmd[0] = "{\"prefix\": \"osd blacklist ls\"}"; | ||
506 | - cmd[1] = NULL; | ||
507 | - | ||
508 | - ret = rados_mon_command(ct->cluster, (const char **)cmd, 1, "", 0, | ||
509 | - &blklist, &blklist_len, &stat, &stat_len); | ||
510 | - if (ret < 0) { | ||
511 | - RBD_MSG(msg, "checker failed: mon command failed %d", ret); | ||
512 | - return ret; | ||
513 | - } | ||
514 | - | ||
515 | - if (!blklist || !blklist_len) | ||
516 | - goto free_bufs; | ||
517 | - | ||
518 | - /* | ||
519 | - * parse list of addrs with the format | ||
520 | - * ipv4:port/nonce date time\n | ||
521 | - * or | ||
522 | - * [ipv6]:port/nonce date time\n | ||
523 | - */ | ||
524 | - ret = 0; | ||
525 | - for (start = blklist; ; start = NULL) { | ||
526 | - addr_tok = strtok_r(start, "\n", &save); | ||
527 | - if (!addr_tok || !strlen(addr_tok)) | ||
528 | - break; | ||
529 | - | ||
530 | - end = strchr(addr_tok, ' '); | ||
531 | - if (!end) { | ||
532 | - RBD_MSG(msg, "checker failed: invalid blacklist %s", | ||
533 | - addr_tok); | ||
534 | - break; | ||
535 | - } | ||
536 | - *end = '\0'; | ||
537 | - | ||
538 | - if (!strcmp(addr_tok, ct->client_addr)) { | ||
539 | - ct->blacklisted = 1; | ||
540 | - RBD_MSG(msg, "%s is blacklisted", ct->client_addr); | ||
541 | - ret = 1; | ||
542 | - break; | ||
543 | - } | ||
544 | - } | ||
545 | - | ||
546 | -free_bufs: | ||
547 | - rados_buffer_free(blklist); | ||
548 | - rados_buffer_free(stat); | ||
549 | - return ret; | ||
550 | -} | ||
551 | - | ||
552 | -static int rbd_check(struct rbd_checker_context *ct, char *msg) | ||
553 | -{ | ||
554 | - if (ct->blacklisted || rbd_is_blacklisted(ct, msg) == 1) | ||
555 | - return PATH_DOWN; | ||
556 | - | ||
557 | - RBD_MSG(msg, "checker reports path is up"); | ||
558 | - /* | ||
559 | - * Path may have issues, but the ceph cluster is at least | ||
560 | - * accepting IO, so we can attempt to do IO. | ||
561 | - * | ||
562 | - * TODO: in future versions, we can run other tests to | ||
563 | - * verify OSDs and networks. | ||
564 | - */ | ||
565 | - return PATH_UP; | ||
566 | -} | ||
567 | - | ||
568 | -static int sysfs_write_rbd_bus(const char *which, const char *buf, | ||
569 | - size_t buf_len) | ||
570 | -{ | ||
571 | - char sysfs_path[PATH_SIZE]; | ||
572 | - int fd; | ||
573 | - int r; | ||
574 | - | ||
575 | - /* we require newer kernels so single_major should always be there */ | ||
576 | - snprintf(sysfs_path, sizeof(sysfs_path), | ||
577 | - "/sys/bus/rbd/%s_single_major", which); | ||
578 | - fd = open(sysfs_path, O_WRONLY); | ||
579 | - if (fd < 0) | ||
580 | - return -errno; | ||
581 | - | ||
582 | - r = safe_write(fd, buf, buf_len); | ||
583 | - close(fd); | ||
584 | - return r; | ||
585 | -} | ||
586 | - | ||
587 | -static int rbd_remap(struct rbd_checker_context *ct) | ||
588 | -{ | ||
589 | - char *argv[11]; | ||
590 | - pid_t pid; | ||
591 | - int ret = 0, i = 0; | ||
592 | - int status; | ||
593 | - | ||
594 | - pid = fork(); | ||
595 | - switch (pid) { | ||
596 | - case 0: | ||
597 | - argv[i++] = "rbd"; | ||
598 | - argv[i++] = "map"; | ||
599 | - if (ct->lock_on_read) | ||
600 | - argv[i++] = "-o noshare,lock_on_read"; | ||
601 | - else | ||
602 | - argv[i++] = "-o noshare"; | ||
603 | - if (ct->username) { | ||
604 | - argv[i++] = "--id"; | ||
605 | - argv[i++] = ct->username; | ||
606 | - } | ||
607 | - argv[i++] = "--pool"; | ||
608 | - argv[i++] = ct->pool; | ||
609 | - if (ct->snap) { | ||
610 | - argv[i++] = "--snap"; | ||
611 | - argv[i++] = ct->snap; | ||
612 | - } | ||
613 | - argv[i++] = ct->image; | ||
614 | - argv[i] = NULL; | ||
615 | - | ||
616 | - ret = execvp(argv[0], argv); | ||
617 | - condlog(0, "rbd%d: Error executing rbd: %s", ct->rbd_bus_id, | ||
618 | - strerror(errno)); | ||
619 | - exit(-1); | ||
620 | - case -1: | ||
621 | - condlog(0, "rbd%d: fork failed: %s", ct->rbd_bus_id, | ||
622 | - strerror(errno)); | ||
623 | - return -1; | ||
624 | - default: | ||
625 | - ret = -1; | ||
626 | - wait(&status); | ||
627 | - if (WIFEXITED(status)) { | ||
628 | - status = WEXITSTATUS(status); | ||
629 | - if (status == 0) | ||
630 | - ret = 0; | ||
631 | - else | ||
632 | - condlog(0, "rbd%d: failed with %d", | ||
633 | - ct->rbd_bus_id, status); | ||
634 | - } | ||
635 | - } | ||
636 | - | ||
637 | - return ret; | ||
638 | -} | ||
639 | - | ||
640 | -static int sysfs_write_rbd_remove(const char *buf, int buf_len) | ||
641 | -{ | ||
642 | - return sysfs_write_rbd_bus("remove", buf, buf_len); | ||
643 | -} | ||
644 | - | ||
645 | -static int rbd_rm_blacklist(struct rbd_checker_context *ct) | ||
646 | -{ | ||
647 | - const char *cmd[2]; | ||
648 | - char *stat, *cmd_str; | ||
649 | - size_t stat_len; | ||
650 | - int ret; | ||
651 | - | ||
652 | - ret = asprintf(&cmd_str, "{\"prefix\": \"osd blacklist\", \"blacklistop\": \"rm\", \"addr\": \"%s\"}", | ||
653 | - ct->client_addr); | ||
654 | - if (ret == -1) | ||
655 | - return -ENOMEM; | ||
656 | - | ||
657 | - cmd[0] = cmd_str; | ||
658 | - cmd[1] = NULL; | ||
659 | - | ||
660 | - ret = rados_mon_command(ct->cluster, (const char **)cmd, 1, "", 0, | ||
661 | - NULL, NULL, &stat, &stat_len); | ||
662 | - if (ret < 0) { | ||
663 | - condlog(1, "rbd%d: repair failed to remove blacklist for %s %d", | ||
664 | - ct->rbd_bus_id, ct->client_addr, ret); | ||
665 | - goto free_cmd; | ||
666 | - } | ||
667 | - | ||
668 | - condlog(1, "rbd%d: repair rm blacklist for %s", | ||
669 | - ct->rbd_bus_id, ct->client_addr); | ||
670 | - free(stat); | ||
671 | -free_cmd: | ||
672 | - free(cmd_str); | ||
673 | - return ret; | ||
674 | -} | ||
675 | - | ||
676 | -static int rbd_repair(struct rbd_checker_context *ct, char *msg) | ||
677 | -{ | ||
678 | - char del[17]; | ||
679 | - int ret; | ||
680 | - | ||
681 | - if (!ct->blacklisted) | ||
682 | - return PATH_UP; | ||
683 | - | ||
684 | - if (!ct->remapped) { | ||
685 | - ret = rbd_remap(ct); | ||
686 | - if (ret) { | ||
687 | - RBD_MSG(msg, "repair failed to remap. Err %d", ret); | ||
688 | - return PATH_DOWN; | ||
689 | - } | ||
690 | - } | ||
691 | - ct->remapped = 1; | ||
692 | - | ||
693 | - snprintf(del, sizeof(del), "%d force", ct->rbd_bus_id); | ||
694 | - ret = sysfs_write_rbd_remove(del, strlen(del) + 1); | ||
695 | - if (ret) { | ||
696 | - RBD_MSG(msg, "repair failed to clean up. Err %d", ret); | ||
697 | - return PATH_DOWN; | ||
698 | - } | ||
699 | - | ||
700 | - ret = rbd_rm_blacklist(ct); | ||
701 | - if (ret) { | ||
702 | - RBD_MSG(msg, "repair could not remove blacklist entry. Err %d", | ||
703 | - ret); | ||
704 | - return PATH_DOWN; | ||
705 | - } | ||
706 | - | ||
707 | - ct->remapped = 0; | ||
708 | - ct->blacklisted = 0; | ||
709 | - | ||
710 | - RBD_MSG(msg, "has been repaired"); | ||
711 | - return PATH_UP; | ||
712 | -} | ||
713 | - | ||
714 | -#define rbd_thread_cleanup_push(ct) pthread_cleanup_push(cleanup_func, ct) | ||
715 | -#define rbd_thread_cleanup_pop(ct) pthread_cleanup_pop(1) | ||
716 | - | ||
717 | -static void cleanup_func(void *data) | ||
718 | -{ | ||
719 | - int holders; | ||
720 | - struct rbd_checker_context *ct = data; | ||
721 | - pthread_spin_lock(&ct->hldr_lock); | ||
722 | - ct->holders--; | ||
723 | - holders = ct->holders; | ||
724 | - ct->thread = 0; | ||
725 | - pthread_spin_unlock(&ct->hldr_lock); | ||
726 | - if (!holders) | ||
727 | - cleanup_context(ct); | ||
728 | - rcu_unregister_thread(); | ||
729 | -} | ||
730 | - | ||
731 | -static void *rbd_thread(void *ctx) | ||
732 | -{ | ||
733 | - struct rbd_checker_context *ct = ctx; | ||
734 | - int state; | ||
735 | - | ||
736 | - /* This thread can be canceled, so setup clean up */ | ||
737 | - rbd_thread_cleanup_push(ct) | ||
738 | - rcu_register_thread(); | ||
739 | - condlog(3, "rbd%d: thread starting up", ct->rbd_bus_id); | ||
740 | - | ||
741 | - ct->message[0] = '\0'; | ||
742 | - | ||
743 | - /* checker start up */ | ||
744 | - pthread_mutex_lock(&ct->lock); | ||
745 | - ct->state = PATH_PENDING; | ||
746 | - pthread_mutex_unlock(&ct->lock); | ||
747 | - | ||
748 | - state = ct->fn(ct, ct->message); | ||
749 | - | ||
750 | - /* checker done */ | ||
751 | - pthread_mutex_lock(&ct->lock); | ||
752 | - ct->state = state; | ||
753 | - pthread_cond_signal(&ct->active); | ||
754 | - pthread_mutex_unlock(&ct->lock); | ||
755 | - | ||
756 | - condlog(3, "rbd%d: thead finished, state %s", ct->rbd_bus_id, | ||
757 | - checker_state_name(state)); | ||
758 | - rbd_thread_cleanup_pop(ct); | ||
759 | - return ((void *)0); | ||
760 | -} | ||
761 | - | ||
762 | -static void rbd_timeout(struct timespec *tsp) | ||
763 | -{ | ||
764 | - clock_gettime(CLOCK_MONOTONIC, tsp); | ||
765 | - tsp->tv_nsec += 1000 * 1000; /* 1 millisecond */ | ||
766 | - normalize_timespec(tsp); | ||
767 | -} | ||
768 | - | ||
769 | -static int rbd_exec_fn(struct checker *c, thread_fn *fn) | ||
770 | -{ | ||
771 | - struct rbd_checker_context *ct = c->context; | ||
772 | - struct timespec tsp; | ||
773 | - pthread_attr_t attr; | ||
774 | - int rbd_status, r; | ||
775 | - | ||
776 | - if (c->sync) | ||
777 | - return fn(ct, c->message); | ||
778 | - /* | ||
779 | - * Async mode | ||
780 | - */ | ||
781 | - r = pthread_mutex_lock(&ct->lock); | ||
782 | - if (r != 0) { | ||
783 | - condlog(2, "rbd%d: mutex lock failed with %d", ct->rbd_bus_id, | ||
784 | - r); | ||
785 | - MSG(c, "rbd%d: thread failed to initialize", ct->rbd_bus_id); | ||
786 | - return PATH_WILD; | ||
787 | - } | ||
788 | - | ||
789 | - if (ct->running) { | ||
790 | - /* Check if checker is still running */ | ||
791 | - if (ct->thread) { | ||
792 | - condlog(3, "rbd%d: thread not finished", | ||
793 | - ct->rbd_bus_id); | ||
794 | - rbd_status = PATH_PENDING; | ||
795 | - } else { | ||
796 | - /* checker done */ | ||
797 | - ct->running = 0; | ||
798 | - rbd_status = ct->state; | ||
799 | - strncpy(c->message, ct->message, CHECKER_MSG_LEN); | ||
800 | - c->message[CHECKER_MSG_LEN - 1] = '\0'; | ||
801 | - } | ||
802 | - pthread_mutex_unlock(&ct->lock); | ||
803 | - } else { | ||
804 | - /* Start new checker */ | ||
805 | - ct->state = PATH_UNCHECKED; | ||
806 | - ct->fn = fn; | ||
807 | - pthread_spin_lock(&ct->hldr_lock); | ||
808 | - ct->holders++; | ||
809 | - pthread_spin_unlock(&ct->hldr_lock); | ||
810 | - setup_thread_attr(&attr, 32 * 1024, 1); | ||
811 | - r = pthread_create(&ct->thread, &attr, rbd_thread, ct); | ||
812 | - if (r) { | ||
813 | - pthread_mutex_unlock(&ct->lock); | ||
814 | - ct->thread = 0; | ||
815 | - ct->holders--; | ||
816 | - condlog(3, "rbd%d failed to start rbd thread, using sync mode", | ||
817 | - ct->rbd_bus_id); | ||
818 | - return fn(ct, c->message); | ||
819 | - } | ||
820 | - pthread_attr_destroy(&attr); | ||
821 | - rbd_timeout(&tsp); | ||
822 | - r = pthread_cond_timedwait(&ct->active, &ct->lock, &tsp); | ||
823 | - rbd_status = ct->state; | ||
824 | - strncpy(c->message, ct->message,CHECKER_MSG_LEN); | ||
825 | - c->message[CHECKER_MSG_LEN -1] = '\0'; | ||
826 | - pthread_mutex_unlock(&ct->lock); | ||
827 | - | ||
828 | - if (ct->thread && | ||
829 | - (rbd_status == PATH_PENDING || rbd_status == PATH_UNCHECKED)) { | ||
830 | - condlog(3, "rbd%d: thread still running", | ||
831 | - ct->rbd_bus_id); | ||
832 | - ct->running = 1; | ||
833 | - rbd_status = PATH_PENDING; | ||
834 | - } | ||
835 | - } | ||
836 | - | ||
837 | - return rbd_status; | ||
838 | -} | ||
839 | - | ||
840 | -void libcheck_repair(struct checker * c) | ||
841 | -{ | ||
842 | - struct rbd_checker_context *ct = c->context; | ||
843 | - | ||
844 | - if (!ct || !ct->blacklisted) | ||
845 | - return; | ||
846 | - rbd_exec_fn(c, rbd_repair); | ||
847 | -} | ||
848 | - | ||
849 | -int libcheck_check(struct checker * c) | ||
850 | -{ | ||
851 | - struct rbd_checker_context *ct = c->context; | ||
852 | - | ||
853 | - if (!ct) | ||
854 | - return PATH_UNCHECKED; | ||
855 | - | ||
856 | - if (ct->blacklisted) | ||
857 | - return PATH_DOWN; | ||
858 | - | ||
859 | - return rbd_exec_fn(c, rbd_check); | ||
860 | -} | ||
861 | diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c | ||
862 | index a643a4a..5104e4e 100644 | ||
863 | --- a/libmultipath/checkers/rdac.c | ||
864 | +++ b/libmultipath/checkers/rdac.c | ||
865 | @@ -139,11 +139,6 @@ void libcheck_free (struct checker * c) | ||
866 | return; | ||
867 | } | ||
868 | |||
869 | -void libcheck_repair (struct checker * c) | ||
870 | -{ | ||
871 | - return; | ||
872 | -} | ||
873 | - | ||
874 | static int | ||
875 | do_inq(int sg_fd, unsigned int pg_op, void *resp, int mx_resp_len, | ||
876 | unsigned int timeout) | ||
877 | diff --git a/libmultipath/checkers/readsector0.c b/libmultipath/checkers/readsector0.c | ||
878 | index 8fccb46..1c2a868 100644 | ||
879 | --- a/libmultipath/checkers/readsector0.c | ||
880 | +++ b/libmultipath/checkers/readsector0.c | ||
881 | @@ -23,11 +23,6 @@ void libcheck_free (struct checker * c) | ||
882 | return; | ||
883 | } | ||
884 | |||
885 | -void libcheck_repair (struct checker * c) | ||
886 | -{ | ||
887 | - return; | ||
888 | -} | ||
889 | - | ||
890 | int libcheck_check (struct checker * c) | ||
891 | { | ||
892 | unsigned char buf[4096]; | ||
893 | diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c | ||
894 | index eb3348d..bf8486d 100644 | ||
895 | --- a/libmultipath/checkers/tur.c | ||
896 | +++ b/libmultipath/checkers/tur.c | ||
897 | @@ -112,11 +112,6 @@ void libcheck_free (struct checker * c) | ||
898 | return; | ||
899 | } | ||
900 | |||
901 | -void libcheck_repair (struct checker * c) | ||
902 | -{ | ||
903 | - return; | ||
904 | -} | ||
905 | - | ||
906 | #define TUR_MSG(fmt, args...) \ | ||
907 | do { \ | ||
908 | char msg[CHECKER_MSG_LEN]; \ | ||
909 | diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c | ||
910 | index 1ef1dfa..18ad0e2 100644 | ||
911 | --- a/libmultipath/discovery.c | ||
912 | +++ b/libmultipath/discovery.c | ||
913 | @@ -1246,21 +1246,6 @@ nvme_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
914 | } | ||
915 | |||
916 | static int | ||
917 | -rbd_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
918 | -{ | ||
919 | - sprintf(pp->vendor_id, "Ceph"); | ||
920 | - sprintf(pp->product_id, "RBD"); | ||
921 | - | ||
922 | - condlog(3, "%s: vendor = %s product = %s", pp->dev, pp->vendor_id, | ||
923 | - pp->product_id); | ||
924 | - /* | ||
925 | - * set the hwe configlet pointer | ||
926 | - */ | ||
927 | - pp->hwe = find_hwe(hwtable, pp->vendor_id, pp->product_id, NULL); | ||
928 | - return 0; | ||
929 | -} | ||
930 | - | ||
931 | -static int | ||
932 | ccw_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
933 | { | ||
934 | struct udev_device *parent; | ||
935 | @@ -1486,8 +1471,6 @@ sysfs_pathinfo(struct path * pp, vector hwtable) | ||
936 | pp->bus = SYSFS_BUS_CCW; | ||
937 | if (!strncmp(pp->dev,"sd", 2)) | ||
938 | pp->bus = SYSFS_BUS_SCSI; | ||
939 | - if (!strncmp(pp->dev,"rbd", 3)) | ||
940 | - pp->bus = SYSFS_BUS_RBD; | ||
941 | if (!strncmp(pp->dev,"nvme", 4)) | ||
942 | pp->bus = SYSFS_BUS_NVME; | ||
943 | |||
944 | @@ -1502,9 +1485,6 @@ sysfs_pathinfo(struct path * pp, vector hwtable) | ||
945 | } else if (pp->bus == SYSFS_BUS_CCISS) { | ||
946 | if (cciss_sysfs_pathinfo(pp, hwtable)) | ||
947 | return 1; | ||
948 | - } else if (pp->bus == SYSFS_BUS_RBD) { | ||
949 | - if (rbd_sysfs_pathinfo(pp, hwtable)) | ||
950 | - return 1; | ||
951 | } else if (pp->bus == SYSFS_BUS_NVME) { | ||
952 | if (nvme_sysfs_pathinfo(pp, hwtable)) | ||
953 | return 1; | ||
954 | @@ -1753,53 +1733,6 @@ get_udev_uid(struct path * pp, char *uid_attribute, struct udev_device *udev) | ||
955 | } | ||
956 | |||
957 | static int | ||
958 | -get_rbd_uid(struct path * pp) | ||
959 | -{ | ||
960 | - struct udev_device *rbd_bus_dev; | ||
961 | - int ret, rbd_bus_id; | ||
962 | - const char *pool, *image, *snap; | ||
963 | - char sysfs_path[PATH_SIZE]; | ||
964 | - uint64_t snap_id, max_snap_id = -3; | ||
965 | - | ||
966 | - ret = sscanf(pp->dev, "rbd%d", &rbd_bus_id); | ||
967 | - if (ret != 1) | ||
968 | - return -EINVAL; | ||
969 | - | ||
970 | - snprintf(sysfs_path, sizeof(sysfs_path), "/sys/bus/rbd/devices/%d", | ||
971 | - rbd_bus_id); | ||
972 | - rbd_bus_dev = udev_device_new_from_syspath(udev, sysfs_path); | ||
973 | - if (!rbd_bus_dev) | ||
974 | - return -ENODEV; | ||
975 | - | ||
976 | - ret = -EINVAL; | ||
977 | - pool = udev_device_get_sysattr_value(rbd_bus_dev, "pool_id"); | ||
978 | - if (!pool) | ||
979 | - goto free_dev; | ||
980 | - | ||
981 | - image = udev_device_get_sysattr_value(rbd_bus_dev, "image_id"); | ||
982 | - if (!image) | ||
983 | - goto free_dev; | ||
984 | - | ||
985 | - snap = udev_device_get_sysattr_value(rbd_bus_dev, "snap_id"); | ||
986 | - if (!snap) | ||
987 | - goto free_dev; | ||
988 | - snap_id = strtoull(snap, NULL, 19); | ||
989 | - if (snap_id >= max_snap_id) | ||
990 | - ret = snprintf(pp->wwid, WWID_SIZE, "%s-%s", pool, image); | ||
991 | - else | ||
992 | - ret = snprintf(pp->wwid, WWID_SIZE, "%s-%s-%s", pool, | ||
993 | - image, snap); | ||
994 | - if (ret >= WWID_SIZE) { | ||
995 | - condlog(0, "%s: wwid overflow", pp->dev); | ||
996 | - ret = -EOVERFLOW; | ||
997 | - } | ||
998 | - | ||
999 | -free_dev: | ||
1000 | - udev_device_unref(rbd_bus_dev); | ||
1001 | - return ret; | ||
1002 | -} | ||
1003 | - | ||
1004 | -static int | ||
1005 | get_vpd_uid(struct path * pp) | ||
1006 | { | ||
1007 | struct udev_device *parent = pp->udev; | ||
1008 | @@ -1876,9 +1809,6 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev) | ||
1009 | } else | ||
1010 | len = strlen(pp->wwid); | ||
1011 | origin = "callout"; | ||
1012 | - } else if (pp->bus == SYSFS_BUS_RBD) { | ||
1013 | - len = get_rbd_uid(pp); | ||
1014 | - origin = "sysfs"; | ||
1015 | } else { | ||
1016 | |||
1017 | if (udev && pp->uid_attribute) { | ||
1018 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
1019 | index 148f0ba..d529bae 100644 | ||
1020 | --- a/libmultipath/hwtable.c | ||
1021 | +++ b/libmultipath/hwtable.c | ||
1022 | @@ -1000,18 +1000,6 @@ static struct hwentry default_hw[] = { | ||
1023 | .prio_name = PRIO_ALUA, | ||
1024 | }, | ||
1025 | /* | ||
1026 | - * Red Hat | ||
1027 | - * | ||
1028 | - * Maintainer: Mike Christie | ||
1029 | - * Mail: mchristi@redhat.com | ||
1030 | - */ | ||
1031 | - { | ||
1032 | - .vendor = "Ceph", | ||
1033 | - .product = "RBD", | ||
1034 | - .checker_name = RBD, | ||
1035 | - .deferred_remove = DEFERRED_REMOVE_ON, | ||
1036 | - }, | ||
1037 | - /* | ||
1038 | * Kove | ||
1039 | */ | ||
1040 | { | ||
1041 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
1042 | index 0c1f174..31f4585 100644 | ||
1043 | --- a/multipath/multipath.conf.5 | ||
1044 | +++ b/multipath/multipath.conf.5 | ||
1045 | @@ -482,9 +482,6 @@ Check the path state for HP/COMPAQ Smart Array(CCISS) controllers. | ||
1046 | .I none | ||
1047 | Do not check the device, fallback to use the values retrieved from sysfs | ||
1048 | .TP | ||
1049 | -.I rbd | ||
1050 | -Check if the path is in the Ceph blacklist and remap the path if it is. | ||
1051 | -.TP | ||
1052 | The default is: \fBtur\fR | ||
1053 | .RE | ||
1054 | . | ||
1055 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
1056 | index 0db88ee..d40c416 100644 | ||
1057 | --- a/multipathd/main.c | ||
1058 | +++ b/multipathd/main.c | ||
1059 | @@ -1783,15 +1783,6 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh) | ||
1060 | return 0; | ||
1061 | } | ||
1062 | |||
1063 | -void repair_path(struct path * pp) | ||
1064 | -{ | ||
1065 | - if (pp->state != PATH_DOWN) | ||
1066 | - return; | ||
1067 | - | ||
1068 | - checker_repair(&pp->checker); | ||
1069 | - LOG_MSG(1, checker_message(&pp->checker)); | ||
1070 | -} | ||
1071 | - | ||
1072 | /* | ||
1073 | * Returns '1' if the path has been checked, '-1' if it was blacklisted | ||
1074 | * and '0' otherwise | ||
1075 | @@ -1972,7 +1963,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) | ||
1076 | pp->mpp->failback_tick = 0; | ||
1077 | |||
1078 | pp->mpp->stat_path_failures++; | ||
1079 | - repair_path(pp); | ||
1080 | return 1; | ||
1081 | } | ||
1082 | |||
1083 | @@ -2071,7 +2061,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) | ||
1084 | } | ||
1085 | |||
1086 | pp->state = newstate; | ||
1087 | - repair_path(pp); | ||
1088 | |||
1089 | if (pp->mpp->wait_for_udev) | ||
1090 | return 1; | ||
1091 | -- | ||
1092 | 2.7.4 | ||
1093 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch b/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch new file mode 100644 index 0000000000..b98d310a13 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch | |||
@@ -0,0 +1,543 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Mon, 4 Jun 2018 22:04:44 -0500 | ||
4 | Subject: [PATCH] mpathpersist: fix aptpl support | ||
5 | |||
6 | The "Active Persist Through Power Loss" flag must be set whenever a key | ||
7 | is registered. However, there is no way for multipathd to know if this | ||
8 | was set by mpathpersist. The result is that if a path goes down and | ||
9 | comes back up (or if it wasn't up when mpathpersist was first run) | ||
10 | multipathd will clear the aptpl flag when it reregisters the key on it. | ||
11 | |||
12 | To fix this, multipath.conf now accepts an optional ":aptpl" appended | ||
13 | on the reservation_key value. If this is added to the reservation_key | ||
14 | multipathd will set the aptpl flag when it reregisters the key. If | ||
15 | reservation_key is set to "file", this will automatically be tracked | ||
16 | in the /etc/multipath/prkeys file. | ||
17 | |||
18 | To track this flag in the prkeys file, without changing the format | ||
19 | I've made "0x<key>" stand for non-aptpl keys, and "0X<key>" stand | ||
20 | for aptpl keys. Since previously, all keys used a lower-case x, this | ||
21 | will default to the current behavior for existing keys. Obviously, the | ||
22 | next time mpathpersist is run, this will be changed if --param-aptpl | ||
23 | is used. Since there are no more flags that are in sg_persist that | ||
24 | multipathd needs to care about in mpathpersist, there shouldn't need | ||
25 | to be any more flags added to the prkeys file. | ||
26 | |||
27 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
28 | --- | ||
29 | libmpathpersist/mpath_persist.c | 3 ++- | ||
30 | libmpathpersist/mpath_updatepr.c | 11 +++++++---- | ||
31 | libmpathpersist/mpathpr.h | 3 ++- | ||
32 | libmultipath/Makefile | 2 +- | ||
33 | libmultipath/config.h | 2 ++ | ||
34 | libmultipath/dict.c | 23 +++++++++++++++++++---- | ||
35 | libmultipath/dict.h | 3 ++- | ||
36 | libmultipath/prkey.c | 27 ++++++++++++++++++++++++--- | ||
37 | libmultipath/prkey.h | 6 ++++-- | ||
38 | libmultipath/propsel.c | 6 ++++-- | ||
39 | libmultipath/structs.h | 1 + | ||
40 | libmultipath/util.c | 16 ++++++++++++++++ | ||
41 | libmultipath/util.h | 1 + | ||
42 | multipath/multipath.conf.5 | 7 +++++-- | ||
43 | multipathd/cli_handlers.c | 15 ++++++++++----- | ||
44 | multipathd/main.c | 1 + | ||
45 | 16 files changed, 101 insertions(+), 26 deletions(-) | ||
46 | |||
47 | diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c | ||
48 | index ca91c55..6e9e67f 100644 | ||
49 | --- a/libmpathpersist/mpath_persist.c | ||
50 | +++ b/libmpathpersist/mpath_persist.c | ||
51 | @@ -344,7 +344,8 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, | ||
52 | rq_servact == MPATH_PROUT_REG_SA) || | ||
53 | rq_servact == MPATH_PROUT_REG_IGN_SA)) { | ||
54 | memcpy(&mpp->reservation_key, paramp->sa_key, 8); | ||
55 | - if (update_prkey(alias, get_be64(mpp->reservation_key))) { | ||
56 | + if (update_prkey_flags(alias, get_be64(mpp->reservation_key), | ||
57 | + paramp->sa_flags)) { | ||
58 | condlog(0, "%s: failed to set prkey for multipathd.", | ||
59 | alias); | ||
60 | ret = MPATH_PR_DMMP_ERROR; | ||
61 | diff --git a/libmpathpersist/mpath_updatepr.c b/libmpathpersist/mpath_updatepr.c | ||
62 | index 8063e90..0aca28e 100644 | ||
63 | --- a/libmpathpersist/mpath_updatepr.c | ||
64 | +++ b/libmpathpersist/mpath_updatepr.c | ||
65 | @@ -1,7 +1,5 @@ | ||
66 | #include <stdio.h> | ||
67 | #include <unistd.h> | ||
68 | -#include <errno.h> | ||
69 | - | ||
70 | #include <stdlib.h> | ||
71 | #include <stdarg.h> | ||
72 | #include <fcntl.h> | ||
73 | @@ -11,6 +9,8 @@ | ||
74 | #include <sys/un.h> | ||
75 | #include <poll.h> | ||
76 | #include <errno.h> | ||
77 | +#include <libudev.h> | ||
78 | +#include <mpath_persist.h> | ||
79 | #include "debug.h" | ||
80 | #include "mpath_cmd.h" | ||
81 | #include "uxsock.h" | ||
82 | @@ -59,11 +59,14 @@ int update_prflag(char *mapname, int set) { | ||
83 | return do_update_pr(mapname, (set)? "setprstatus" : "unsetprstatus"); | ||
84 | } | ||
85 | |||
86 | -int update_prkey(char *mapname, uint64_t prkey) { | ||
87 | +int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags) { | ||
88 | char str[256]; | ||
89 | + char *flagstr = ""; | ||
90 | |||
91 | + if (sa_flags & MPATH_F_APTPL_MASK) | ||
92 | + flagstr = ":aptpl"; | ||
93 | if (prkey) | ||
94 | - sprintf(str, "setprkey key %" PRIx64, prkey); | ||
95 | + sprintf(str, "setprkey key %" PRIx64 "%s", prkey, flagstr); | ||
96 | else | ||
97 | sprintf(str, "unsetprkey"); | ||
98 | return do_update_pr(mapname, str); | ||
99 | diff --git a/libmpathpersist/mpathpr.h b/libmpathpersist/mpathpr.h | ||
100 | index 72feb60..5ea8cd6 100644 | ||
101 | --- a/libmpathpersist/mpathpr.h | ||
102 | +++ b/libmpathpersist/mpathpr.h | ||
103 | @@ -46,7 +46,8 @@ int send_prout_activepath(char * dev, int rq_servact, int rq_scope, | ||
104 | unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy); | ||
105 | |||
106 | int update_prflag(char *mapname, int set); | ||
107 | -int update_prkey(char *mapname, uint64_t prkey); | ||
108 | +int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags); | ||
109 | +#define update_prkey(mapname, prkey) update_prkey_flags(mapname, prkey, 0) | ||
110 | void * mpath_alloc_prin_response(int prin_sa); | ||
111 | int update_map_pr(struct multipath *mpp); | ||
112 | |||
113 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile | ||
114 | index f51786d..33f5269 100644 | ||
115 | --- a/libmultipath/Makefile | ||
116 | +++ b/libmultipath/Makefile | ||
117 | @@ -7,7 +7,7 @@ SONAME = 0 | ||
118 | DEVLIB = libmultipath.so | ||
119 | LIBS = $(DEVLIB).$(SONAME) | ||
120 | |||
121 | -CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) | ||
122 | +CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) -I$(mpathpersistdir) | ||
123 | |||
124 | LIBDEPS += -lpthread -ldl -ldevmapper -ludev -L$(mpathcmddir) -lmpathcmd -lurcu -laio | ||
125 | |||
126 | diff --git a/libmultipath/config.h b/libmultipath/config.h | ||
127 | index 1bf708a..fcbe3fc 100644 | ||
128 | --- a/libmultipath/config.h | ||
129 | +++ b/libmultipath/config.h | ||
130 | @@ -98,6 +98,7 @@ struct mpentry { | ||
131 | char * prio_args; | ||
132 | int prkey_source; | ||
133 | struct be64 reservation_key; | ||
134 | + uint8_t sa_flags; | ||
135 | int pgpolicy; | ||
136 | int pgfailback; | ||
137 | int rr_weight; | ||
138 | @@ -197,6 +198,7 @@ struct config { | ||
139 | int prkey_source; | ||
140 | int all_tg_pt; | ||
141 | struct be64 reservation_key; | ||
142 | + uint8_t sa_flags; | ||
143 | |||
144 | vector keywords; | ||
145 | vector mptable; | ||
146 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
147 | index 2557b8a..7ad0f5a 100644 | ||
148 | --- a/libmultipath/dict.c | ||
149 | +++ b/libmultipath/dict.c | ||
150 | @@ -22,6 +22,8 @@ | ||
151 | #include "util.h" | ||
152 | #include <errno.h> | ||
153 | #include <inttypes.h> | ||
154 | +#include <libudev.h> | ||
155 | +#include <mpath_persist.h> | ||
156 | #include "mpath_cmd.h" | ||
157 | #include "dict.h" | ||
158 | |||
159 | @@ -1012,10 +1014,12 @@ snprint_def_log_checker_err (struct config *conf, char * buff, int len, | ||
160 | } | ||
161 | |||
162 | static int | ||
163 | -set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr) | ||
164 | +set_reservation_key(vector strvec, struct be64 *be64_ptr, uint8_t *flags_ptr, | ||
165 | + int *source_ptr) | ||
166 | { | ||
167 | char *buff; | ||
168 | uint64_t prkey; | ||
169 | + uint8_t sa_flags; | ||
170 | |||
171 | buff = set_value(strvec); | ||
172 | if (!buff) | ||
173 | @@ -1023,35 +1027,43 @@ set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr) | ||
174 | |||
175 | if (strcmp(buff, "file") == 0) { | ||
176 | *source_ptr = PRKEY_SOURCE_FILE; | ||
177 | + *flags_ptr = 0; | ||
178 | put_be64(*be64_ptr, 0); | ||
179 | FREE(buff); | ||
180 | return 0; | ||
181 | } | ||
182 | |||
183 | - if (parse_prkey(buff, &prkey) != 0) { | ||
184 | + if (parse_prkey_flags(buff, &prkey, &sa_flags) != 0) { | ||
185 | FREE(buff); | ||
186 | return 1; | ||
187 | } | ||
188 | *source_ptr = PRKEY_SOURCE_CONF; | ||
189 | + *flags_ptr = sa_flags; | ||
190 | put_be64(*be64_ptr, prkey); | ||
191 | FREE(buff); | ||
192 | return 0; | ||
193 | } | ||
194 | |||
195 | int | ||
196 | -print_reservation_key(char * buff, int len, struct be64 key, int source) | ||
197 | +print_reservation_key(char * buff, int len, struct be64 key, uint8_t flags, | ||
198 | + int source) | ||
199 | { | ||
200 | + char *flagstr = ""; | ||
201 | if (source == PRKEY_SOURCE_NONE) | ||
202 | return 0; | ||
203 | if (source == PRKEY_SOURCE_FILE) | ||
204 | return snprintf(buff, len, "file"); | ||
205 | - return snprintf(buff, len, "0x%" PRIx64, get_be64(key)); | ||
206 | + if (flags & MPATH_F_APTPL_MASK) | ||
207 | + flagstr = ":aptpl"; | ||
208 | + return snprintf(buff, len, "0x%" PRIx64 "%s", get_be64(key), | ||
209 | + flagstr); | ||
210 | } | ||
211 | |||
212 | static int | ||
213 | def_reservation_key_handler(struct config *conf, vector strvec) | ||
214 | { | ||
215 | return set_reservation_key(strvec, &conf->reservation_key, | ||
216 | + &conf->sa_flags, | ||
217 | &conf->prkey_source); | ||
218 | } | ||
219 | |||
220 | @@ -1060,6 +1072,7 @@ snprint_def_reservation_key (struct config *conf, char * buff, int len, | ||
221 | const void * data) | ||
222 | { | ||
223 | return print_reservation_key(buff, len, conf->reservation_key, | ||
224 | + conf->sa_flags, | ||
225 | conf->prkey_source); | ||
226 | } | ||
227 | |||
228 | @@ -1070,6 +1083,7 @@ mp_reservation_key_handler(struct config *conf, vector strvec) | ||
229 | if (!mpe) | ||
230 | return 1; | ||
231 | return set_reservation_key(strvec, &mpe->reservation_key, | ||
232 | + &mpe->sa_flags, | ||
233 | &mpe->prkey_source); | ||
234 | } | ||
235 | |||
236 | @@ -1079,6 +1093,7 @@ snprint_mp_reservation_key (struct config *conf, char * buff, int len, | ||
237 | { | ||
238 | const struct mpentry * mpe = (const struct mpentry *)data; | ||
239 | return print_reservation_key(buff, len, mpe->reservation_key, | ||
240 | + mpe->sa_flags, | ||
241 | mpe->prkey_source); | ||
242 | } | ||
243 | |||
244 | diff --git a/libmultipath/dict.h b/libmultipath/dict.h | ||
245 | index 7564892..a40ac66 100644 | ||
246 | --- a/libmultipath/dict.h | ||
247 | +++ b/libmultipath/dict.h | ||
248 | @@ -15,6 +15,7 @@ int print_pgpolicy(char *buff, int len, long v); | ||
249 | int print_no_path_retry(char *buff, int len, long v); | ||
250 | int print_fast_io_fail(char *buff, int len, long v); | ||
251 | int print_dev_loss(char *buff, int len, unsigned long v); | ||
252 | -int print_reservation_key(char * buff, int len, struct be64 key, int source); | ||
253 | +int print_reservation_key(char * buff, int len, struct be64 key, uint8_t | ||
254 | + flags, int source); | ||
255 | int print_off_int_undef(char *buff, int len, long v); | ||
256 | #endif /* _DICT_H */ | ||
257 | diff --git a/libmultipath/prkey.c b/libmultipath/prkey.c | ||
258 | index 89b90ed..d645f81 100644 | ||
259 | --- a/libmultipath/prkey.c | ||
260 | +++ b/libmultipath/prkey.c | ||
261 | @@ -11,6 +11,8 @@ | ||
262 | #include <string.h> | ||
263 | #include <inttypes.h> | ||
264 | #include <errno.h> | ||
265 | +#include <libudev.h> | ||
266 | +#include <mpath_persist.h> | ||
267 | |||
268 | #define PRKEY_READ 0 | ||
269 | #define PRKEY_WRITE 1 | ||
270 | @@ -108,7 +110,8 @@ static int do_prkey(int fd, char *wwid, char *keystr, int cmd) | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | -int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey) | ||
275 | +int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey, | ||
276 | + uint8_t *sa_flags) | ||
277 | { | ||
278 | int fd; | ||
279 | int unused; | ||
280 | @@ -124,6 +127,9 @@ int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey) | ||
281 | ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_READ); | ||
282 | if (ret) | ||
283 | goto out_file; | ||
284 | + *sa_flags = 0; | ||
285 | + if (strchr(keystr, 'X')) | ||
286 | + *sa_flags = MPATH_F_APTPL_MASK; | ||
287 | ret = !!parse_prkey(keystr, prkey); | ||
288 | out_file: | ||
289 | close(fd); | ||
290 | @@ -131,7 +137,8 @@ out: | ||
291 | return ret; | ||
292 | } | ||
293 | |||
294 | -int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
295 | +int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey, | ||
296 | + uint8_t sa_flags) | ||
297 | { | ||
298 | int fd; | ||
299 | int can_write = 1; | ||
300 | @@ -141,6 +148,12 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
301 | if (!strlen(mpp->wwid)) | ||
302 | goto out; | ||
303 | |||
304 | + if (sa_flags & ~MPATH_F_APTPL_MASK) { | ||
305 | + condlog(0, "unsupported pr flags, 0x%x", | ||
306 | + sa_flags & ~MPATH_F_APTPL_MASK); | ||
307 | + sa_flags &= MPATH_F_APTPL_MASK; | ||
308 | + } | ||
309 | + | ||
310 | fd = open_file(conf->prkeys_file, &can_write, PRKEYS_FILE_HEADER); | ||
311 | if (fd < 0) | ||
312 | goto out; | ||
313 | @@ -149,7 +162,15 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
314 | goto out_file; | ||
315 | } | ||
316 | if (prkey) { | ||
317 | - snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey); | ||
318 | + /* using the capitalization of the 'x' is a hack, but | ||
319 | + * it's unlikely that mpath_persist will support more options | ||
320 | + * since sg_persist doesn't, and this lets us keep the | ||
321 | + * same file format as before instead of needing to change | ||
322 | + * the format of the prkeys file */ | ||
323 | + if (sa_flags) | ||
324 | + snprintf(keystr, PRKEY_SIZE, "0X%016" PRIx64, prkey); | ||
325 | + else | ||
326 | + snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey); | ||
327 | keystr[PRKEY_SIZE - 1] = '\0'; | ||
328 | ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_WRITE); | ||
329 | } | ||
330 | diff --git a/libmultipath/prkey.h b/libmultipath/prkey.h | ||
331 | index 4028e70..6739191 100644 | ||
332 | --- a/libmultipath/prkey.h | ||
333 | +++ b/libmultipath/prkey.h | ||
334 | @@ -13,7 +13,9 @@ | ||
335 | "# prkey wwid\n" \ | ||
336 | "#\n" | ||
337 | |||
338 | -int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey); | ||
339 | -int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey); | ||
340 | +int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey, | ||
341 | + uint8_t sa_flags); | ||
342 | +int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey, | ||
343 | + uint8_t *sa_flags); | ||
344 | |||
345 | #endif /* _PRKEY_H */ | ||
346 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
347 | index 9ca1355..62a6893 100644 | ||
348 | --- a/libmultipath/propsel.c | ||
349 | +++ b/libmultipath/propsel.c | ||
350 | @@ -106,6 +106,7 @@ do { \ | ||
351 | if (src && src->prkey_source != PRKEY_SOURCE_NONE) { \ | ||
352 | mp->prkey_source = src->prkey_source; \ | ||
353 | mp->reservation_key = src->reservation_key; \ | ||
354 | + mp->sa_flags = src->sa_flags; \ | ||
355 | origin = msg; \ | ||
356 | goto out; \ | ||
357 | } \ | ||
358 | @@ -703,18 +704,19 @@ int select_reservation_key(struct config *conf, struct multipath *mp) | ||
359 | do_prkey_set(mp->mpe, multipaths_origin); | ||
360 | do_prkey_set(conf, conf_origin); | ||
361 | put_be64(mp->reservation_key, 0); | ||
362 | + mp->sa_flags = 0; | ||
363 | mp->prkey_source = PRKEY_SOURCE_NONE; | ||
364 | return 0; | ||
365 | out: | ||
366 | if (mp->prkey_source == PRKEY_SOURCE_FILE) { | ||
367 | from_file = " (from prkeys file)"; | ||
368 | - if (get_prkey(conf, mp, &prkey) != 0) | ||
369 | + if (get_prkey(conf, mp, &prkey, &mp->sa_flags) != 0) | ||
370 | put_be64(mp->reservation_key, 0); | ||
371 | else | ||
372 | put_be64(mp->reservation_key, prkey); | ||
373 | } | ||
374 | print_reservation_key(buff, PRKEY_SIZE, mp->reservation_key, | ||
375 | - mp->prkey_source); | ||
376 | + mp->sa_flags, mp->prkey_source); | ||
377 | condlog(3, "%s: reservation_key = %s %s%s", mp->alias, buff, origin, | ||
378 | from_file); | ||
379 | return 0; | ||
380 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
381 | index 0194b1e..987479f 100644 | ||
382 | --- a/libmultipath/structs.h | ||
383 | +++ b/libmultipath/structs.h | ||
384 | @@ -367,6 +367,7 @@ struct multipath { | ||
385 | /* persistent management data*/ | ||
386 | int prkey_source; | ||
387 | struct be64 reservation_key; | ||
388 | + uint8_t sa_flags; | ||
389 | unsigned char prflag; | ||
390 | int all_tg_pt; | ||
391 | struct gen_multipath generic_mp; | ||
392 | diff --git a/libmultipath/util.c b/libmultipath/util.c | ||
393 | index 7251ad0..8d8fcc8 100644 | ||
394 | --- a/libmultipath/util.c | ||
395 | +++ b/libmultipath/util.c | ||
396 | @@ -10,6 +10,8 @@ | ||
397 | #include <dirent.h> | ||
398 | #include <unistd.h> | ||
399 | #include <errno.h> | ||
400 | +#include <libudev.h> | ||
401 | +#include <mpath_persist.h> | ||
402 | |||
403 | #include "util.h" | ||
404 | #include "debug.h" | ||
405 | @@ -435,6 +437,20 @@ int parse_prkey(char *ptr, uint64_t *prkey) | ||
406 | return 0; | ||
407 | } | ||
408 | |||
409 | +int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags) | ||
410 | +{ | ||
411 | + char *flagstr; | ||
412 | + | ||
413 | + flagstr = strchr(ptr, ':'); | ||
414 | + *flags = 0; | ||
415 | + if (flagstr) { | ||
416 | + *flagstr++ = '\0'; | ||
417 | + if (strlen(flagstr) == 5 && strcmp(flagstr, "aptpl") == 0) | ||
418 | + *flags = MPATH_F_APTPL_MASK; | ||
419 | + } | ||
420 | + return parse_prkey(ptr, prkey); | ||
421 | +} | ||
422 | + | ||
423 | int safe_write(int fd, const void *buf, size_t count) | ||
424 | { | ||
425 | while (count > 0) { | ||
426 | diff --git a/libmultipath/util.h b/libmultipath/util.h | ||
427 | index a3ab894..56cec76 100644 | ||
428 | --- a/libmultipath/util.h | ||
429 | +++ b/libmultipath/util.h | ||
430 | @@ -19,6 +19,7 @@ void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached); | ||
431 | int systemd_service_enabled(const char *dev); | ||
432 | int get_linux_version_code(void); | ||
433 | int parse_prkey(char *ptr, uint64_t *prkey); | ||
434 | +int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags); | ||
435 | int safe_write(int fd, const void *buf, size_t count); | ||
436 | |||
437 | #define KERNEL_VERSION(maj, min, ptc) ((((maj) * 256) + (min)) * 256 + (ptc)) | ||
438 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
439 | index 31f4585..30d8598 100644 | ||
440 | --- a/multipath/multipath.conf.5 | ||
441 | +++ b/multipath/multipath.conf.5 | ||
442 | @@ -726,14 +726,17 @@ This is the service action reservation key used by mpathpersist. It must be | ||
443 | set for all multipath devices using persistent reservations, and it must be | ||
444 | the same as the RESERVATION KEY field of the PERSISTENT RESERVE OUT parameter | ||
445 | list which contains an 8-byte value provided by the application client to the | ||
446 | -device server to identify the I_T nexus. | ||
447 | +device server to identify the I_T nexus. If the \fI--param-aptpl\fR option is | ||
448 | +used when registering the key with mpathpersist, \fB:aptpl\fR must be appended | ||
449 | +to the end of the reservation key. | ||
450 | .RS | ||
451 | .PP | ||
452 | Alternatively, this can be set to \fBfile\fR, which will store the RESERVATION | ||
453 | KEY registered by mpathpersist in the \fIprkeys_file\fR. multipathd will then | ||
454 | use this key to register additional paths as they appear. When the | ||
455 | registration is removed, the RESERVATION KEY is removed from the | ||
456 | -\fIprkeys_file\fR. | ||
457 | +\fIprkeys_file\fR. The prkeys file will automatically keep track of whether | ||
458 | +the key was registered with \fI--param-aptpl\fR. | ||
459 | .TP | ||
460 | The default is: \fB<unset>\fR | ||
461 | .RE | ||
462 | diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c | ||
463 | index ba50fb8..6452796 100644 | ||
464 | --- a/multipathd/cli_handlers.c | ||
465 | +++ b/multipathd/cli_handlers.c | ||
466 | @@ -21,6 +21,7 @@ | ||
467 | #include "sysfs.h" | ||
468 | #include <errno.h> | ||
469 | #include <libudev.h> | ||
470 | +#include <mpath_persist.h> | ||
471 | #include "util.h" | ||
472 | #include "prkey.h" | ||
473 | #include "propsel.h" | ||
474 | @@ -1463,6 +1464,7 @@ cli_getprkey(void * v, char ** reply, int * len, void * data) | ||
475 | struct multipath * mpp; | ||
476 | struct vectors * vecs = (struct vectors *)data; | ||
477 | char *mapname = get_keyparam(v, MAP); | ||
478 | + char *flagstr = ""; | ||
479 | |||
480 | mapname = convert_dev(mapname, 0); | ||
481 | condlog(3, "%s: get persistent reservation key (operator)", mapname); | ||
482 | @@ -1478,8 +1480,10 @@ cli_getprkey(void * v, char ** reply, int * len, void * data) | ||
483 | *len = strlen(*reply) + 1; | ||
484 | return 0; | ||
485 | } | ||
486 | - snprintf(*reply, 20, "0x%" PRIx64 "\n", | ||
487 | - get_be64(mpp->reservation_key)); | ||
488 | + if (mpp->sa_flags & MPATH_F_APTPL_MASK) | ||
489 | + flagstr = ":aptpl"; | ||
490 | + snprintf(*reply, 20, "0x%" PRIx64 "%s\n", | ||
491 | + get_be64(mpp->reservation_key), flagstr); | ||
492 | (*reply)[19] = '\0'; | ||
493 | *len = strlen(*reply) + 1; | ||
494 | return 0; | ||
495 | @@ -1503,7 +1507,7 @@ cli_unsetprkey(void * v, char ** reply, int * len, void * data) | ||
496 | |||
497 | conf = get_multipath_config(); | ||
498 | pthread_cleanup_push(put_multipath_config, conf); | ||
499 | - ret = set_prkey(conf, mpp, 0); | ||
500 | + ret = set_prkey(conf, mpp, 0, 0); | ||
501 | pthread_cleanup_pop(1); | ||
502 | |||
503 | return ret; | ||
504 | @@ -1517,6 +1521,7 @@ cli_setprkey(void * v, char ** reply, int * len, void * data) | ||
505 | char *mapname = get_keyparam(v, MAP); | ||
506 | char *keyparam = get_keyparam(v, KEY); | ||
507 | uint64_t prkey; | ||
508 | + uint8_t flags; | ||
509 | int ret; | ||
510 | struct config *conf; | ||
511 | |||
512 | @@ -1527,14 +1532,14 @@ cli_setprkey(void * v, char ** reply, int * len, void * data) | ||
513 | if (!mpp) | ||
514 | return 1; | ||
515 | |||
516 | - if (parse_prkey(keyparam, &prkey) != 0) { | ||
517 | + if (parse_prkey_flags(keyparam, &prkey, &flags) != 0) { | ||
518 | condlog(0, "%s: invalid prkey : '%s'", mapname, keyparam); | ||
519 | return 1; | ||
520 | } | ||
521 | |||
522 | conf = get_multipath_config(); | ||
523 | pthread_cleanup_push(put_multipath_config, conf); | ||
524 | - ret = set_prkey(conf, mpp, prkey); | ||
525 | + ret = set_prkey(conf, mpp, prkey, flags); | ||
526 | pthread_cleanup_pop(1); | ||
527 | |||
528 | return ret; | ||
529 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
530 | index d40c416..6b1e782 100644 | ||
531 | --- a/multipathd/main.c | ||
532 | +++ b/multipathd/main.c | ||
533 | @@ -3089,6 +3089,7 @@ void * mpath_pr_event_handler_fn (void * pathp ) | ||
534 | |||
535 | param= malloc(sizeof(struct prout_param_descriptor)); | ||
536 | memset(param, 0 , sizeof(struct prout_param_descriptor)); | ||
537 | + param->sa_flags = mpp->sa_flags; | ||
538 | memcpy(param->sa_key, &mpp->reservation_key, 8); | ||
539 | param->num_transportid = 0; | ||
540 | |||
541 | -- | ||
542 | 2.7.4 | ||
543 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch b/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch new file mode 100644 index 0000000000..5a3fd8374b --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Tue, 5 Jun 2018 15:31:55 -0500 | ||
4 | Subject: [PATCH] multipath: don't check timestamps without a path | ||
5 | |||
6 | If a path was blacklisted, pathvec could exist but have no path in it. | ||
7 | print_cmd_valid wasn't checking this before calling | ||
8 | find_multipaths_check_timeout(). This was causing it to dereference a | ||
9 | NULL pointer in these cases. | ||
10 | |||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | multipath/main.c | 4 +--- | ||
14 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/multipath/main.c b/multipath/main.c | ||
17 | index c69e996..3f0a6aa 100644 | ||
18 | --- a/multipath/main.c | ||
19 | +++ b/multipath/main.c | ||
20 | @@ -482,10 +482,8 @@ static int print_cmd_valid(int k, const vector pathvec, | ||
21 | pp, pp->find_multipaths_timeout, &until); | ||
22 | if (wait != FIND_MULTIPATHS_WAITING) | ||
23 | k = 1; | ||
24 | - } else if (pathvec != NULL) { | ||
25 | - pp = VECTOR_SLOT(pathvec, 0); | ||
26 | + } else if (pathvec != NULL && (pp = VECTOR_SLOT(pathvec, 0))) | ||
27 | wait = find_multipaths_check_timeout(pp, 0, &until); | ||
28 | - } | ||
29 | if (wait == FIND_MULTIPATHS_WAITING) | ||
30 | printf("FIND_MULTIPATHS_WAIT_UNTIL=\"%ld.%06ld\"\n", | ||
31 | until.tv_sec, until.tv_nsec/1000); | ||
32 | -- | ||
33 | 2.7.4 | ||
34 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch b/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch new file mode 100644 index 0000000000..23908fa585 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Fri, 8 Jun 2018 17:12:37 -0500 | ||
4 | Subject: [PATCH] libmultipath: fix detect alua corner case | ||
5 | |||
6 | If retain_attach_hw_handler = no, then the paths tpgs state will never | ||
7 | be checked, and the multipath device will always select the alua | ||
8 | handler, if no other handler is selected. the paths tpgs state | ||
9 | should be checked, regardless of the retain_hwhandler value. | ||
10 | |||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | libmultipath/propsel.c | 4 +++- | ||
14 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
17 | index 62a6893..f626c74 100644 | ||
18 | --- a/libmultipath/propsel.c | ||
19 | +++ b/libmultipath/propsel.c | ||
20 | @@ -403,9 +403,11 @@ int select_hwhandler(struct config *conf, struct multipath *mp) | ||
21 | bool all_tpgs = true; | ||
22 | |||
23 | dh_state = &handler[2]; | ||
24 | + | ||
25 | + vector_foreach_slot(mp->paths, pp, i) | ||
26 | + all_tpgs = all_tpgs && (pp->tpgs > 0); | ||
27 | if (mp->retain_hwhandler != RETAIN_HWHANDLER_OFF) { | ||
28 | vector_foreach_slot(mp->paths, pp, i) { | ||
29 | - all_tpgs = all_tpgs && (pp->tpgs > 0); | ||
30 | if (get_dh_state(pp, dh_state, sizeof(handler) - 2) > 0 | ||
31 | && strcmp(dh_state, "detached")) { | ||
32 | memcpy(handler, "1 ", 2); | ||
33 | -- | ||
34 | 2.7.4 | ||
35 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch b/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch new file mode 100644 index 0000000000..624f45efd8 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Fri, 8 Jun 2018 17:23:07 -0500 | ||
4 | Subject: [PATCH] multipath: fix setting conf->version | ||
5 | |||
6 | Commit d3b71498 stopped multipath from setting conf->version. Instead, | ||
7 | it was always being set to 0.0.0. Multipathd was still setting this | ||
8 | correctly. | ||
9 | |||
10 | Fixes: d3b71498 "multipath: fix rcu thread cancellation hang" | ||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | libmultipath/devmapper.c | 6 +++--- | ||
14 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c | ||
17 | index f2befad..8136d15 100644 | ||
18 | --- a/libmultipath/devmapper.c | ||
19 | +++ b/libmultipath/devmapper.c | ||
20 | @@ -245,13 +245,13 @@ void libmp_dm_init(void) | ||
21 | int verbosity; | ||
22 | unsigned int version[3]; | ||
23 | |||
24 | + if (dm_prereq(version)) | ||
25 | + exit(1); | ||
26 | conf = get_multipath_config(); | ||
27 | verbosity = conf->verbosity; | ||
28 | - memcpy(version, conf->version, sizeof(version)); | ||
29 | + memcpy(conf->version, version, sizeof(version)); | ||
30 | put_multipath_config(conf); | ||
31 | dm_init(verbosity); | ||
32 | - if (dm_prereq(version)) | ||
33 | - exit(1); | ||
34 | dm_udev_set_sync_support(libmp_dm_udev_sync); | ||
35 | } | ||
36 | |||
37 | -- | ||
38 | 2.7.4 | ||
39 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0021-RH-fixup-udev-rules-for-redhat.patch b/meta-oe/recipes-support/multipath-tools/files/0021-RH-fixup-udev-rules-for-redhat.patch new file mode 100644 index 0000000000..4ef3e708da --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0021-RH-fixup-udev-rules-for-redhat.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Thu, 13 Apr 2017 07:22:23 -0500 | ||
4 | Subject: [PATCH] RH: fixup udev rules for redhat | ||
5 | |||
6 | The multipath rules need to run after scsi_id is run. This means moving | ||
7 | them after 60-persistent-storage.rules for redhat. Redhat also uses a | ||
8 | different naming scheme for partitions than SuSE. Also, there are some | ||
9 | false warnings that gcc throws because of the changed options. Fix these | ||
10 | too. | ||
11 | |||
12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
13 | --- | ||
14 | Makefile.inc | 2 +- | ||
15 | kpartx/kpartx.rules | 2 +- | ||
16 | multipath/Makefile | 4 ++-- | ||
17 | multipath/main.c | 2 +- | ||
18 | 4 files changed, 5 insertions(+), 5 deletions(-) | ||
19 | |||
20 | diff --git a/Makefile.inc b/Makefile.inc | ||
21 | index af2f5ba..0b271ea 100644 | ||
22 | --- a/Makefile.inc | ||
23 | +++ b/Makefile.inc | ||
24 | @@ -51,7 +51,7 @@ endif | ||
25 | prefix = | ||
26 | exec_prefix = $(prefix) | ||
27 | usr_prefix = $(prefix) | ||
28 | -bindir = $(exec_prefix)/sbin | ||
29 | +bindir = $(exec_prefix)/usr/sbin | ||
30 | libudevdir = $(prefix)/$(SYSTEMDPATH)/udev | ||
31 | udevrulesdir = $(libudevdir)/rules.d | ||
32 | multipathdir = $(TOPDIR)/libmultipath | ||
33 | diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules | ||
34 | index 8f99049..8a3a171 100644 | ||
35 | --- a/kpartx/kpartx.rules | ||
36 | +++ b/kpartx/kpartx.rules | ||
37 | @@ -32,6 +32,6 @@ LABEL="mpath_kpartx_end" | ||
38 | GOTO="kpartx_end" | ||
39 | |||
40 | LABEL="run_kpartx" | ||
41 | -RUN+="/sbin/kpartx -un -p -part /dev/$name" | ||
42 | +RUN+="/sbin/kpartx -un /dev/$name" | ||
43 | |||
44 | LABEL="kpartx_end" | ||
45 | diff --git a/multipath/Makefile b/multipath/Makefile | ||
46 | index 0828a8f..b9bbb3c 100644 | ||
47 | --- a/multipath/Makefile | ||
48 | +++ b/multipath/Makefile | ||
49 | @@ -24,7 +24,7 @@ install: | ||
50 | $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/ | ||
51 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir) | ||
52 | $(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir) | ||
53 | - $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules | ||
54 | + $(INSTALL_PROGRAM) -m 644 $(EXEC).rules $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules | ||
55 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(man8dir) | ||
56 | $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(man8dir) | ||
57 | $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir) | ||
58 | @@ -33,7 +33,7 @@ install: | ||
59 | uninstall: | ||
60 | $(RM) $(DESTDIR)$(bindir)/$(EXEC) | ||
61 | $(RM) $(DESTDIR)$(udevrulesdir)/11-dm-mpath.rules | ||
62 | - $(RM) $(DESTDIR)$(libudevdir)/rules.d/56-multipath.rules | ||
63 | + $(RM) $(DESTDIR)$(libudevdir)/rules.d/62-multipath.rules | ||
64 | $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz | ||
65 | $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz | ||
66 | |||
67 | diff --git a/multipath/main.c b/multipath/main.c | ||
68 | index 3f0a6aa..6fdde03 100644 | ||
69 | --- a/multipath/main.c | ||
70 | +++ b/multipath/main.c | ||
71 | @@ -389,7 +389,7 @@ static int find_multipaths_check_timeout(const struct path *pp, long tmo, | ||
72 | struct timespec now, ftimes[2], tdiff; | ||
73 | struct stat st; | ||
74 | long fd; | ||
75 | - int r, err, retries = 0; | ||
76 | + int r, err = 0, retries = 0; | ||
77 | |||
78 | clock_gettime(CLOCK_REALTIME, &now); | ||
79 | |||
80 | -- | ||
81 | 2.7.4 | ||
82 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0003-RH-Remove-the-property-blacklist-exception-builtin.patch b/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch index 684e959d66..451c524c9a 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0003-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 69a67c2ed09ae51b53de402966a9f7a4cc737715 Mon Sep 17 00:00:00 2001 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
3 | Date: Wed, 2 Jul 2014 12:49:53 -0500 | 3 | Date: Wed, 2 Jul 2014 12:49:53 -0500 |
4 | Subject: [PATCH 03/14] RH: Remove the property blacklist exception builtin | 4 | Subject: [PATCH] RH: Remove the property blacklist exception builtin |
5 | 5 | ||
6 | Multipath set the default property blacklist exceptions to | 6 | Multipath set the default property blacklist exceptions to |
7 | (ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal | 7 | (ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal |
@@ -14,8 +14,8 @@ it. | |||
14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
15 | --- | 15 | --- |
16 | libmultipath/blacklist.c | 15 ++++++--------- | 16 | libmultipath/blacklist.c | 15 ++++++--------- |
17 | multipath/multipath.conf.5 | 4 ---- | 17 | multipath/multipath.conf.5 | 14 ++++++++------ |
18 | 2 files changed, 6 insertions(+), 13 deletions(-) | 18 | 2 files changed, 14 insertions(+), 15 deletions(-) |
19 | 19 | ||
20 | diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c | 20 | diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c |
21 | index ee396e2..19d4697 100644 | 21 | index ee396e2..19d4697 100644 |
@@ -51,10 +51,10 @@ index ee396e2..19d4697 100644 | |||
51 | 51 | ||
52 | void | 52 | void |
53 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | 53 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 |
54 | index f04ff19..fbbbb27 100644 | 54 | index 30d8598..c45da9f 100644 |
55 | --- a/multipath/multipath.conf.5 | 55 | --- a/multipath/multipath.conf.5 |
56 | +++ b/multipath/multipath.conf.5 | 56 | +++ b/multipath/multipath.conf.5 |
57 | @@ -1014,10 +1014,6 @@ The \fIWorld Wide Identification\fR of a device. | 57 | @@ -1179,10 +1179,6 @@ The \fIWorld Wide Identification\fR of a device. |
58 | .TP | 58 | .TP |
59 | .B property | 59 | .B property |
60 | Regular expression of the udev property to be whitelisted. | 60 | Regular expression of the udev property to be whitelisted. |
@@ -65,6 +65,23 @@ index f04ff19..fbbbb27 100644 | |||
65 | .TP | 65 | .TP |
66 | .B device | 66 | .B device |
67 | Subsection for the device description. This subsection recognizes the | 67 | Subsection for the device description. This subsection recognizes the |
68 | @@ -1193,8 +1189,14 @@ keywords. For a full description of these keywords please see the \fIdevices\fR | ||
69 | section description. | ||
70 | .LP | ||
71 | The \fIproperty\fR whitelist handling is different from the usual | ||
72 | -handling in the sense that the device \fIhas\fR to have a udev property that | ||
73 | -matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed. | ||
74 | +handling in the sense that if the propery whitelist is set, the device | ||
75 | +\fIhas\fR to have a udev property that matches the whitelist, otherwise the | ||
76 | +device will be blacklisted. In these cases the message \fIblacklisted, udev | ||
77 | +property missing\fR will be displayed. For example settting the | ||
78 | +property blacklist_exception to \fB(SCSI_IDENT_|ID_WWN)\fR will blacklist | ||
79 | +all devices that have no udev property whose name regex matches either | ||
80 | +\fBSCSI_IDENT_\fR or \fBID_WWN\fR. This works to exclude most | ||
81 | +non-multipathable devices. | ||
82 | . | ||
83 | . | ||
84 | .\" ---------------------------------------------------------------------------- | ||
68 | -- | 85 | -- |
69 | 2.8.1 | 86 | 2.7.4 |
70 | 87 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0004-RH-don-t-start-without-a-config-file.patch b/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch index 87a6d3fb65..886f1c86f1 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0004-RH-don-t-start-without-a-config-file.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From b2b504fc1959c7a3f0a843c3c204e8e193b675b7 Mon Sep 17 00:00:00 2001 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
3 | Date: Wed, 15 Oct 2014 10:39:30 -0500 | 3 | Date: Wed, 15 Oct 2014 10:39:30 -0500 |
4 | Subject: [PATCH 04/14] RH: don't start without a config file | 4 | Subject: [PATCH] RH: don't start without a config file |
5 | 5 | ||
6 | If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist | 6 | If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist |
7 | all devices when running multipath. A completely blank configuration file | 7 | all devices when running multipath. A completely blank configuration file |
@@ -12,33 +12,31 @@ simple way to disable multipath. Simply removing or renaming | |||
12 | 12 | ||
13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
14 | --- | 14 | --- |
15 | libmultipath/config.c | 17 +++++++++++++++++ | 15 | libmultipath/config.c | 15 +++++++++++++++ |
16 | libmultipath/config.h | 1 + | 16 | libmultipath/config.h | 1 + |
17 | multipath/multipath.rules | 1 + | 17 | multipath/multipath.rules | 1 + |
18 | multipathd/multipathd.8 | 2 ++ | 18 | multipathd/multipathd.8 | 2 ++ |
19 | multipathd/multipathd.service | 1 + | 19 | multipathd/multipathd.service | 1 + |
20 | 5 files changed, 22 insertions(+) | 20 | 5 files changed, 20 insertions(+) |
21 | 21 | ||
22 | diff --git a/libmultipath/config.c b/libmultipath/config.c | 22 | diff --git a/libmultipath/config.c b/libmultipath/config.c |
23 | index bb6619b..aae69b8 100644 | 23 | index 5872927..0607403 100644 |
24 | --- a/libmultipath/config.c | 24 | --- a/libmultipath/config.c |
25 | +++ b/libmultipath/config.c | 25 | +++ b/libmultipath/config.c |
26 | @@ -25,6 +25,7 @@ | 26 | @@ -26,6 +26,7 @@ |
27 | #include "prio.h" | ||
28 | #include "devmapper.h" | 27 | #include "devmapper.h" |
29 | #include "mpath_cmd.h" | 28 | #include "mpath_cmd.h" |
29 | #include "propsel.h" | ||
30 | +#include "version.h" | 30 | +#include "version.h" |
31 | 31 | ||
32 | static int | 32 | static int |
33 | hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) | 33 | hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) |
34 | @@ -667,6 +668,22 @@ load_config (char * file) | 34 | @@ -658,6 +659,20 @@ load_config (char * file) |
35 | factorize_hwtable(conf->hwtable, builtin_hwtable_size); | 35 | factorize_hwtable(conf->hwtable, builtin_hwtable_size); |
36 | } | 36 | } |
37 | 37 | ||
38 | + } else { | 38 | + } else { |
39 | + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); | 39 | + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); |
40 | + condlog(0, "A default multipath.conf file is located at"); | ||
41 | + condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); | ||
42 | + if (conf->blist_devnode == NULL) { | 40 | + if (conf->blist_devnode == NULL) { |
43 | + conf->blist_devnode = vector_alloc(); | 41 | + conf->blist_devnode = vector_alloc(); |
44 | + if (!conf->blist_devnode) { | 42 | + if (!conf->blist_devnode) { |
@@ -55,10 +53,10 @@ index bb6619b..aae69b8 100644 | |||
55 | 53 | ||
56 | conf->processed_main_config = 1; | 54 | conf->processed_main_config = 1; |
57 | diff --git a/libmultipath/config.h b/libmultipath/config.h | 55 | diff --git a/libmultipath/config.h b/libmultipath/config.h |
58 | index ffc69b5..614331c 100644 | 56 | index fcbe3fc..3a42435 100644 |
59 | --- a/libmultipath/config.h | 57 | --- a/libmultipath/config.h |
60 | +++ b/libmultipath/config.h | 58 | +++ b/libmultipath/config.h |
61 | @@ -7,6 +7,7 @@ | 59 | @@ -9,6 +9,7 @@ |
62 | 60 | ||
63 | #define ORIGIN_DEFAULT 0 | 61 | #define ORIGIN_DEFAULT 0 |
64 | #define ORIGIN_CONFIG 1 | 62 | #define ORIGIN_CONFIG 1 |
@@ -67,36 +65,36 @@ index ffc69b5..614331c 100644 | |||
67 | /* | 65 | /* |
68 | * In kernel, fast_io_fail == 0 means immediate failure on rport delete. | 66 | * In kernel, fast_io_fail == 0 means immediate failure on rport delete. |
69 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules | 67 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules |
70 | index 4d78b98..5753766 100644 | 68 | index d658073..b3f54d7 100644 |
71 | --- a/multipath/multipath.rules | 69 | --- a/multipath/multipath.rules |
72 | +++ b/multipath/multipath.rules | 70 | +++ b/multipath/multipath.rules |
73 | @@ -6,6 +6,7 @@ IMPORT{cmdline}="nompath" | 71 | @@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath" |
74 | ENV{nompath}=="?*", GOTO="end_mpath" | 72 | ENV{nompath}=="?*", GOTO="end_mpath" |
75 | IMPORT{cmdline}="multipath" | 73 | IMPORT{cmdline}="multipath" |
76 | ENV{multipath}=="off", GOTO="end_mpath" | 74 | ENV{multipath}=="off", GOTO="end_mpath" |
77 | +TEST!="/etc/multipath.conf", GOTO="end_mpath" | 75 | +TEST!="/etc/multipath.conf", GOTO="end_mpath" |
78 | 76 | ||
79 | KERNEL=="dm-*", GOTO="check_kpartx" | ||
80 | ENV{DEVTYPE}!="partition", GOTO="test_dev" | 77 | ENV{DEVTYPE}!="partition", GOTO="test_dev" |
78 | IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH" | ||
81 | diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8 | 79 | diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8 |
82 | index 4c765af..c1499a5 100644 | 80 | index e78ac9e..09cdead 100644 |
83 | --- a/multipathd/multipathd.8 | 81 | --- a/multipathd/multipathd.8 |
84 | +++ b/multipathd/multipathd.8 | 82 | +++ b/multipathd/multipathd.8 |
85 | @@ -39,6 +39,8 @@ map regains its maximum performance and redundancy. | 83 | @@ -38,6 +38,8 @@ map regains its maximum performance and redundancy. |
86 | This daemon executes the external \fBmultipath\fR tool when events occur. | 84 | This daemon executes the external \fBmultipath\fR tool when events occur. |
87 | In turn, the multipath tool signals the multipathd daemon when it is done with | 85 | In turn, the multipath tool signals the multipathd daemon when it is done with |
88 | devmap reconfiguration, so that it can refresh its failed path list. | 86 | devmap reconfiguration, so that it can refresh its failed path list. |
89 | + | 87 | + |
90 | +In this Linux distribution, multipathd does not run unless a /etc/multipath.conffile exists | 88 | +In this Linux distribution, multipathd does not run unless a /etc/multipath.conf file exists. |
91 | . | 89 | . |
92 | . | 90 | . |
93 | .\" ---------------------------------------------------------------------------- | 91 | .\" ---------------------------------------------------------------------------- |
94 | diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service | 92 | diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service |
95 | index fd66cf6..fafd088 100644 | 93 | index ba24983..17434ce 100644 |
96 | --- a/multipathd/multipathd.service | 94 | --- a/multipathd/multipathd.service |
97 | +++ b/multipathd/multipathd.service | 95 | +++ b/multipathd/multipathd.service |
98 | @@ -4,6 +4,7 @@ Wants=systemd-udev-trigger.service systemd-udev-settle.service | 96 | @@ -4,6 +4,7 @@ Wants=systemd-udev-trigger.service systemd-udev-settle.service |
99 | Before=iscsi.service iscsid.service lvm2-lvmetad.service lvm2-activation-early.service | 97 | Before=iscsi.service iscsid.service lvm2-activation-early.service |
100 | Before=local-fs-pre.target blk-availability.service | 98 | Before=local-fs-pre.target blk-availability.service |
101 | After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service | 99 | After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service |
102 | +ConditionPathExists=/etc/multipath.conf | 100 | +ConditionPathExists=/etc/multipath.conf |
@@ -104,5 +102,5 @@ index fd66cf6..fafd088 100644 | |||
104 | Conflicts=shutdown.target | 102 | Conflicts=shutdown.target |
105 | ConditionKernelCommandLine=!nompath | 103 | ConditionKernelCommandLine=!nompath |
106 | -- | 104 | -- |
107 | 2.8.1 | 105 | 2.7.4 |
108 | 106 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch b/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch new file mode 100644 index 0000000000..9330bf0701 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Wed, 19 Apr 2017 06:10:01 -0500 | ||
4 | Subject: [PATCH] RH: use rpm optflags if present | ||
5 | |||
6 | Use the passed in optflags when compiling as an RPM, and keep the | ||
7 | default flags as close as possible to the current fedora flags, while | ||
8 | still being generic. | ||
9 | |||
10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
11 | --- | ||
12 | Makefile.inc | 24 ++++++++++++++++-------- | ||
13 | 1 file changed, 16 insertions(+), 8 deletions(-) | ||
14 | |||
15 | diff --git a/Makefile.inc b/Makefile.inc | ||
16 | index 0b271ea..5ff69a3 100644 | ||
17 | --- a/Makefile.inc | ||
18 | +++ b/Makefile.inc | ||
19 | @@ -85,14 +85,22 @@ TEST_CC_OPTION = $(shell \ | ||
20 | echo "$(2)"; \ | ||
21 | fi) | ||
22 | |||
23 | -STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) | ||
24 | - | ||
25 | -OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ | ||
26 | - -Werror=implicit-function-declaration -Werror=format-security \ | ||
27 | - -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ | ||
28 | - -Werror=cast-qual -Werror=discarded-qualifiers \ | ||
29 | - -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ | ||
30 | - --param=ssp-buffer-size=4 | ||
31 | +ifndef RPM_OPT_FLAGS | ||
32 | + STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) | ||
33 | + OPTFLAGS = -O2 -g -pipe -Wall -Werror=format-security \ | ||
34 | + -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \ | ||
35 | + $(STACKPROT) --param=ssp-buffer-size=4 \ | ||
36 | + -grecord-gcc-switches | ||
37 | + ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1) | ||
38 | + OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 | ||
39 | + endif | ||
40 | +else | ||
41 | + OPTFLAGS = $(RPM_OPT_FLAGS) | ||
42 | +endif | ||
43 | +OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \ | ||
44 | + -Werror=implicit-function-declaration -Wno-sign-compare \ | ||
45 | + -Wno-unused-parameter -Werror=cast-qual \ | ||
46 | + -Werror=discarded-qualifiers | ||
47 | |||
48 | CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ | ||
49 | -MMD -MP $(CFLAGS) | ||
50 | -- | ||
51 | 2.7.4 | ||
52 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0005-RH-add-mpathconf.patch b/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch index acef41023b..5cad22b2b2 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0005-RH-add-mpathconf.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From de44504fe7f7802cd474efd92ac15b5a8857db1f Mon Sep 17 00:00:00 2001 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
3 | Date: Thu, 16 Oct 2014 15:49:01 -0500 | 3 | Date: Thu, 16 Oct 2014 15:49:01 -0500 |
4 | Subject: [PATCH 05/14] RH: add mpathconf | 4 | Subject: [PATCH] RH: add mpathconf |
5 | 5 | ||
6 | mpathconf is a program (largely based on lvmcomf) to help users | 6 | mpathconf is a program (largely based on lvmcomf) to help users |
7 | configure /etc/multipath.conf and enable or disable multipathing. It | 7 | configure /etc/multipath.conf and enable or disable multipathing. It |
@@ -21,22 +21,22 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | |||
21 | create mode 100644 multipath/mpathconf.8 | 21 | create mode 100644 multipath/mpathconf.8 |
22 | 22 | ||
23 | diff --git a/libmultipath/config.c b/libmultipath/config.c | 23 | diff --git a/libmultipath/config.c b/libmultipath/config.c |
24 | index aae69b8..c485748 100644 | 24 | index 0607403..5c98e48 100644 |
25 | --- a/libmultipath/config.c | 25 | --- a/libmultipath/config.c |
26 | +++ b/libmultipath/config.c | 26 | +++ b/libmultipath/config.c |
27 | @@ -672,6 +672,7 @@ load_config (char * file) | 27 | @@ -661,6 +661,7 @@ load_config (char * file) |
28 | |||
29 | } else { | ||
28 | condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); | 30 | condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); |
29 | condlog(0, "A default multipath.conf file is located at"); | ||
30 | condlog(0, "/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf", MULTIPATH_VERSION(VERSION_CODE)); | ||
31 | + condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf"); | 31 | + condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf"); |
32 | if (conf->blist_devnode == NULL) { | 32 | if (conf->blist_devnode == NULL) { |
33 | conf->blist_devnode = vector_alloc(); | 33 | conf->blist_devnode = vector_alloc(); |
34 | if (!conf->blist_devnode) { | 34 | if (!conf->blist_devnode) { |
35 | diff --git a/multipath/Makefile b/multipath/Makefile | 35 | diff --git a/multipath/Makefile b/multipath/Makefile |
36 | index 1e9ee4b..3d4d459 100644 | 36 | index b9bbb3c..e720c7f 100644 |
37 | --- a/multipath/Makefile | 37 | --- a/multipath/Makefile |
38 | +++ b/multipath/Makefile | 38 | +++ b/multipath/Makefile |
39 | @@ -18,10 +18,12 @@ $(EXEC): $(OBJS) | 39 | @@ -18,10 +18,12 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so |
40 | $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS) | 40 | $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS) |
41 | $(GZIP) $(EXEC).8 > $(EXEC).8.gz | 41 | $(GZIP) $(EXEC).8 > $(EXEC).8.gz |
42 | $(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz | 42 | $(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz |
@@ -64,7 +64,7 @@ index 1e9ee4b..3d4d459 100644 | |||
64 | $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz | 64 | $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz |
65 | + $(RM) $(DESTDIR)$(man8dir)/mpathconf.8.gz | 65 | + $(RM) $(DESTDIR)$(man8dir)/mpathconf.8.gz |
66 | 66 | ||
67 | clean: | 67 | clean: dep_clean |
68 | $(RM) core *.o $(EXEC) *.gz | 68 | $(RM) core *.o $(EXEC) *.gz |
69 | diff --git a/multipath/mpathconf b/multipath/mpathconf | 69 | diff --git a/multipath/mpathconf b/multipath/mpathconf |
70 | new file mode 100644 | 70 | new file mode 100644 |
@@ -644,5 +644,5 @@ index 0000000..4cd3267 | |||
644 | +.SH AUTHOR | 644 | +.SH AUTHOR |
645 | +Benjamin Marzinski <bmarzins@redhat.com> | 645 | +Benjamin Marzinski <bmarzins@redhat.com> |
646 | -- | 646 | -- |
647 | 2.8.1 | 647 | 2.7.4 |
648 | 648 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0006-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index dc291b8128..ddf022f762 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0006-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 15179c830521d8f37f9254ebc6bbf150a409f956 Mon Sep 17 00:00:00 2001 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
3 | Date: Fri, 17 Oct 2014 11:20:34 -0500 | 3 | Date: Fri, 17 Oct 2014 11:20:34 -0500 |
4 | Subject: [PATCH 06/14] RH: add wwids from kernel cmdline mpath.wwids with -A | 4 | Subject: [PATCH] RH: add wwids from kernel cmdline mpath.wwids with -A |
5 | 5 | ||
6 | This patch adds another option to multipath, "-A", which reads | 6 | This patch adds another option to multipath, "-A", which reads |
7 | /proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds | 7 | /proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds |
@@ -22,13 +22,13 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | |||
22 | 5 files changed, 58 insertions(+), 3 deletions(-) | 22 | 5 files changed, 58 insertions(+), 3 deletions(-) |
23 | 23 | ||
24 | diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c | 24 | diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c |
25 | index bc70a27..88bb72b 100644 | 25 | index 53e7951..39e08cd 100644 |
26 | --- a/libmultipath/wwids.c | 26 | --- a/libmultipath/wwids.c |
27 | +++ b/libmultipath/wwids.c | 27 | +++ b/libmultipath/wwids.c |
28 | @@ -321,3 +321,47 @@ remember_wwid(char *wwid) | 28 | @@ -443,3 +443,47 @@ int op ## _wwid(const char *wwid) \ |
29 | condlog(4, "wwid %s already in wwids file", wwid); | 29 | declare_failed_wwid_op(is_failed, false) |
30 | return 0; | 30 | declare_failed_wwid_op(mark_failed, true) |
31 | } | 31 | declare_failed_wwid_op(unmark_failed, true) |
32 | + | 32 | + |
33 | +int remember_cmdline_wwid(void) | 33 | +int remember_cmdline_wwid(void) |
34 | +{ | 34 | +{ |
@@ -74,21 +74,22 @@ index bc70a27..88bb72b 100644 | |||
74 | + return ret; | 74 | + return ret; |
75 | +} | 75 | +} |
76 | diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h | 76 | diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h |
77 | index 9527012..b665232 100644 | 77 | index 0c6ee54..e32a0b0 100644 |
78 | --- a/libmultipath/wwids.h | 78 | --- a/libmultipath/wwids.h |
79 | +++ b/libmultipath/wwids.h | 79 | +++ b/libmultipath/wwids.h |
80 | @@ -17,5 +17,6 @@ int remember_wwid(char *wwid); | 80 | @@ -17,6 +17,7 @@ int remember_wwid(char *wwid); |
81 | int check_wwids_file(char *wwid, int write_wwid); | 81 | int check_wwids_file(char *wwid, int write_wwid); |
82 | int remove_wwid(char *wwid); | 82 | int remove_wwid(char *wwid); |
83 | int replace_wwids(vector mp); | 83 | int replace_wwids(vector mp); |
84 | +int remember_cmdline_wwid(void); | 84 | +int remember_cmdline_wwid(void); |
85 | 85 | ||
86 | #endif /* _WWIDS_H */ | 86 | enum { |
87 | WWID_IS_NOT_FAILED = 0, | ||
87 | diff --git a/multipath/main.c b/multipath/main.c | 88 | diff --git a/multipath/main.c b/multipath/main.c |
88 | index 4174d43..72585b0 100644 | 89 | index 6fdde03..7bac232 100644 |
89 | --- a/multipath/main.c | 90 | --- a/multipath/main.c |
90 | +++ b/multipath/main.c | 91 | +++ b/multipath/main.c |
91 | @@ -102,7 +102,7 @@ usage (char * progname) | 92 | @@ -109,7 +109,7 @@ usage (char * progname) |
92 | { | 93 | { |
93 | fprintf (stderr, VERSION_STRING); | 94 | fprintf (stderr, VERSION_STRING); |
94 | fprintf (stderr, "Usage:\n"); | 95 | fprintf (stderr, "Usage:\n"); |
@@ -97,25 +98,25 @@ index 4174d43..72585b0 100644 | |||
97 | fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [-R num] [dev]\n", progname); | 98 | fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [-R num] [dev]\n", progname); |
98 | fprintf (stderr, " %s -F [-v lvl] [-R num]\n", progname); | 99 | fprintf (stderr, " %s -F [-v lvl] [-R num]\n", progname); |
99 | fprintf (stderr, " %s -t\n", progname); | 100 | fprintf (stderr, " %s -t\n", progname); |
100 | @@ -116,6 +116,8 @@ usage (char * progname) | 101 | @@ -123,6 +123,8 @@ usage (char * progname) |
101 | " -f flush a multipath device map\n" | 102 | " -f flush a multipath device map\n" |
102 | " -F flush all multipath device maps\n" | 103 | " -F flush all multipath device maps\n" |
103 | " -a add a device wwid to the wwids file\n" | 104 | " -a add a device wwid to the wwids file\n" |
104 | + " -A add devices from kernel command line mpath.wwids\n" | 105 | + " -A add devices from kernel command line mpath.wwids\n" |
105 | + " parameters to wwids file\n" | 106 | + " parameters to wwids file\n" |
106 | " -c check if a device should be a path in a multipath device\n" | 107 | " -c check if a device should be a path in a multipath device\n" |
108 | " -C check if a multipath device has usable paths\n" | ||
107 | " -q allow queue_if_no_path when multipathd is not running\n" | 109 | " -q allow queue_if_no_path when multipathd is not running\n" |
108 | " -d dry run, do not create or update devmaps\n" | 110 | @@ -907,7 +909,7 @@ main (int argc, char *argv[]) |
109 | @@ -522,7 +524,7 @@ main (int argc, char *argv[]) | ||
110 | exit(1); | 111 | exit(1); |
111 | multipath_conf = conf; | 112 | multipath_conf = conf; |
112 | conf->retrigger_tries = 0; | 113 | conf->retrigger_tries = 0; |
113 | - while ((arg = getopt(argc, argv, ":adchl::FfM:v:p:b:BrR:itquwW")) != EOF ) { | 114 | - while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) { |
114 | + while ((arg = getopt(argc, argv, ":aAdchl::FfM:v:p:b:BrR:itquwW")) != EOF ) { | 115 | + while ((arg = getopt(argc, argv, ":aAdcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) { |
115 | switch(arg) { | 116 | switch(arg) { |
116 | case 1: printf("optarg : %s\n",optarg); | 117 | case 1: printf("optarg : %s\n",optarg); |
117 | break; | 118 | break; |
118 | @@ -586,6 +588,10 @@ main (int argc, char *argv[]) | 119 | @@ -974,6 +976,10 @@ main (int argc, char *argv[]) |
119 | case 't': | 120 | case 't': |
120 | r = dump_config(conf); | 121 | r = dump_config(conf); |
121 | goto out_free_config; | 122 | goto out_free_config; |
@@ -127,19 +128,19 @@ index 4174d43..72585b0 100644 | |||
127 | usage(argv[0]); | 128 | usage(argv[0]); |
128 | exit(0); | 129 | exit(0); |
129 | diff --git a/multipath/multipath.8 b/multipath/multipath.8 | 130 | diff --git a/multipath/multipath.8 b/multipath/multipath.8 |
130 | index b9436e5..b9ad6b1 100644 | 131 | index 914a8cb..8c6a4c1 100644 |
131 | --- a/multipath/multipath.8 | 132 | --- a/multipath/multipath.8 |
132 | +++ b/multipath/multipath.8 | 133 | +++ b/multipath/multipath.8 |
133 | @@ -25,7 +25,7 @@ multipath \- Device mapper target autoconfig. | 134 | @@ -25,7 +25,7 @@ multipath \- Device mapper target autoconfig. |
134 | .RB [\| \-b\ \c | 135 | .RB [\| \-b\ \c |
135 | .IR bindings_file \|] | 136 | .IR bindings_file \|] |
136 | .RB [\| \-d \|] | 137 | .RB [\| \-d \|] |
137 | -.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \|-i | \-a | \|-u | \-w | \-W \|] | 138 | -.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-u | \-U | \-w | \-W \|] |
138 | +.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-q | \|-r | \|-i | \-a | \-A | \-u | \-w | \-W \|] | 139 | +.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-A | \-u | \-U | \-w | \-W \|] |
139 | .RB [\| \-p\ \c | 140 | .RB [\| \-p\ \c |
140 | .IR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] | 141 | .IR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] |
141 | .RB [\| \-R\ \c | 142 | .RB [\| \-R\ \c |
142 | @@ -122,6 +122,9 @@ Add the WWID for the specified device to the WWIDs file. | 143 | @@ -135,6 +135,9 @@ Add the WWID for the specified device to the WWIDs file. |
143 | Check if the device specified in the program environment should be | 144 | Check if the device specified in the program environment should be |
144 | a path in a multipath device. | 145 | a path in a multipath device. |
145 | . | 146 | . |
@@ -147,10 +148,10 @@ index b9436e5..b9ad6b1 100644 | |||
147 | +add wwids from any kernel command line mpath.wwid parameters to the wwids file | 148 | +add wwids from any kernel command line mpath.wwid parameters to the wwids file |
148 | +. | 149 | +. |
149 | .TP | 150 | .TP |
150 | .B \-w | 151 | .B \-U |
151 | Remove the WWID for the specified device from the WWIDs file. | 152 | Check if the device specified in the program environment is a multipath device |
152 | diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service | 153 | diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service |
153 | index fafd088..a623a3f 100644 | 154 | index 17434ce..0fbcc46 100644 |
154 | --- a/multipathd/multipathd.service | 155 | --- a/multipathd/multipathd.service |
155 | +++ b/multipathd/multipathd.service | 156 | +++ b/multipathd/multipathd.service |
156 | @@ -15,6 +15,7 @@ Type=notify | 157 | @@ -15,6 +15,7 @@ Type=notify |
@@ -160,7 +161,7 @@ index fafd088..a623a3f 100644 | |||
160 | +ExecStartPre=-/sbin/multipath -A | 161 | +ExecStartPre=-/sbin/multipath -A |
161 | ExecStart=/sbin/multipathd -d -s | 162 | ExecStart=/sbin/multipathd -d -s |
162 | ExecReload=/sbin/multipathd reconfigure | 163 | ExecReload=/sbin/multipathd reconfigure |
163 | 164 | TasksMax=infinity | |
164 | -- | 165 | -- |
165 | 2.8.1 | 166 | 2.7.4 |
166 | 167 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch b/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch new file mode 100644 index 0000000000..a23e167393 --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Mon, 6 Nov 2017 21:39:28 -0600 | ||
4 | Subject: [PATCH] RH: warn on invalid regex instead of failing | ||
5 | |||
6 | multipath.conf used to allow "*" as a match everything regular expression, | ||
7 | instead of requiring ".*". Instead of erroring when the old style | ||
8 | regular expressions are used, it should print a warning and convert | ||
9 | them. | ||
10 | |||
11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
12 | --- | ||
13 | libmultipath/dict.c | 27 +++++++++++++++++++++------ | ||
14 | libmultipath/parser.c | 13 +++++++++++++ | ||
15 | libmultipath/parser.h | 1 + | ||
16 | 3 files changed, 35 insertions(+), 6 deletions(-) | ||
17 | |||
18 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
19 | index 7ad0f5a..ab808d6 100644 | ||
20 | --- a/libmultipath/dict.c | ||
21 | +++ b/libmultipath/dict.c | ||
22 | @@ -55,6 +55,21 @@ set_str(vector strvec, void *ptr) | ||
23 | } | ||
24 | |||
25 | static int | ||
26 | +set_regex(vector strvec, void *ptr) | ||
27 | +{ | ||
28 | + char **str_ptr = (char **)ptr; | ||
29 | + | ||
30 | + if (*str_ptr) | ||
31 | + FREE(*str_ptr); | ||
32 | + *str_ptr = set_regex_value(strvec); | ||
33 | + | ||
34 | + if (!*str_ptr) | ||
35 | + return 1; | ||
36 | + | ||
37 | + return 0; | ||
38 | +} | ||
39 | + | ||
40 | +static int | ||
41 | set_yes_no(vector strvec, void *ptr) | ||
42 | { | ||
43 | char * buff; | ||
44 | @@ -1271,7 +1286,7 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \ | ||
45 | if (!conf->option) \ | ||
46 | return 1; \ | ||
47 | \ | ||
48 | - buff = set_value(strvec); \ | ||
49 | + buff = set_regex_value(strvec); \ | ||
50 | if (!buff) \ | ||
51 | return 1; \ | ||
52 | \ | ||
53 | @@ -1287,7 +1302,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ | ||
54 | if (!conf->option) \ | ||
55 | return 1; \ | ||
56 | \ | ||
57 | - buff = set_value(strvec); \ | ||
58 | + buff = set_regex_value(strvec); \ | ||
59 | if (!buff) \ | ||
60 | return 1; \ | ||
61 | \ | ||
62 | @@ -1388,16 +1403,16 @@ device_handler(struct config *conf, vector strvec) | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | -declare_hw_handler(vendor, set_str) | ||
67 | +declare_hw_handler(vendor, set_regex) | ||
68 | declare_hw_snprint(vendor, print_str) | ||
69 | |||
70 | -declare_hw_handler(product, set_str) | ||
71 | +declare_hw_handler(product, set_regex) | ||
72 | declare_hw_snprint(product, print_str) | ||
73 | |||
74 | -declare_hw_handler(revision, set_str) | ||
75 | +declare_hw_handler(revision, set_regex) | ||
76 | declare_hw_snprint(revision, print_str) | ||
77 | |||
78 | -declare_hw_handler(bl_product, set_str) | ||
79 | +declare_hw_handler(bl_product, set_regex) | ||
80 | declare_hw_snprint(bl_product, print_str) | ||
81 | |||
82 | declare_hw_handler(hwhandler, set_str) | ||
83 | diff --git a/libmultipath/parser.c b/libmultipath/parser.c | ||
84 | index b8b7e0d..34b4ad2 100644 | ||
85 | --- a/libmultipath/parser.c | ||
86 | +++ b/libmultipath/parser.c | ||
87 | @@ -380,6 +380,19 @@ set_value(vector strvec) | ||
88 | return alloc; | ||
89 | } | ||
90 | |||
91 | +void * | ||
92 | +set_regex_value(vector strvec) | ||
93 | +{ | ||
94 | + char *buff = set_value(strvec); | ||
95 | + | ||
96 | + if (buff && strcmp("*", buff) == 0) { | ||
97 | + condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\""); | ||
98 | + FREE(buff); | ||
99 | + return strdup(".*"); | ||
100 | + } | ||
101 | + return buff; | ||
102 | +} | ||
103 | + | ||
104 | /* non-recursive configuration stream handler */ | ||
105 | static int kw_level = 0; | ||
106 | |||
107 | diff --git a/libmultipath/parser.h b/libmultipath/parser.h | ||
108 | index 62906e9..b791705 100644 | ||
109 | --- a/libmultipath/parser.h | ||
110 | +++ b/libmultipath/parser.h | ||
111 | @@ -77,6 +77,7 @@ extern void dump_keywords(vector keydump, int level); | ||
112 | extern void free_keywords(vector keywords); | ||
113 | extern vector alloc_strvec(char *string); | ||
114 | extern void *set_value(vector strvec); | ||
115 | +extern void *set_regex_value(vector strvec); | ||
116 | extern int process_file(struct config *conf, char *conf_file); | ||
117 | extern struct keyword * find_keyword(vector keywords, vector v, char * name); | ||
118 | int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, | ||
119 | -- | ||
120 | 2.7.4 | ||
121 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch b/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch new file mode 100644 index 0000000000..05e686492e --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
3 | Date: Thu, 7 Jun 2018 17:43:52 -0500 | ||
4 | Subject: [PATCH] RH: reset default find_mutipaths value to off | ||
5 | |||
6 | Upstream has changed to default find_multipaths to "strict". For now | ||
7 | Redhat will retain the previous default of "off". | ||
8 | |||
9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
10 | --- | ||
11 | libmultipath/defaults.h | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h | ||
15 | index f076b4b..70ba98a 100644 | ||
16 | --- a/libmultipath/defaults.h | ||
17 | +++ b/libmultipath/defaults.h | ||
18 | @@ -17,7 +17,7 @@ | ||
19 | #define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF | ||
20 | #define DEFAULT_VERBOSITY 2 | ||
21 | #define DEFAULT_REASSIGN_MAPS 0 | ||
22 | -#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT | ||
23 | +#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF | ||
24 | #define DEFAULT_FAST_IO_FAIL 5 | ||
25 | #define DEFAULT_DEV_LOSS_TMO 600 | ||
26 | #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON | ||
27 | -- | ||
28 | 2.7.4 | ||
29 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch b/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch new file mode 100644 index 0000000000..45cd32ac2e --- /dev/null +++ b/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 8bdd4481d822b6625d8bf719431ca74ed1b5e021 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Mon, 16 Jul 2018 15:56:37 +0800 | ||
4 | Subject: [PATCH] multipath-tools: modify Makefile.inc for cross-compilation | ||
5 | |||
6 | Do not look for systemd info on the host, and allow us to pass in CFLAGS | ||
7 | using the OPTFLAGS variable. | ||
8 | |||
9 | Upstream-Status: Inappropriate [embedded specific] | ||
10 | |||
11 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
12 | |||
13 | Update for version 0.5.0-144-g770e6d0 | ||
14 | |||
15 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
16 | |||
17 | Update for version 0.7.1 | ||
18 | |||
19 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
20 | |||
21 | update for version 0.7.7 | ||
22 | |||
23 | remove change about CFLAGS part, since patch 0024 already have similar function. | ||
24 | |||
25 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
26 | --- | ||
27 | Makefile.inc | 8 ++------ | ||
28 | 1 file changed, 2 insertions(+), 6 deletions(-) | ||
29 | |||
30 | diff --git a/Makefile.inc b/Makefile.inc | ||
31 | index 57a1835..0c403c7 100644 | ||
32 | --- a/Makefile.inc | ||
33 | +++ b/Makefile.inc | ||
34 | @@ -38,12 +38,6 @@ ifndef RUN | ||
35 | endif | ||
36 | endif | ||
37 | |||
38 | -ifndef SYSTEMD | ||
39 | - ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1) | ||
40 | - SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p') | ||
41 | - endif | ||
42 | -endif | ||
43 | - | ||
44 | ifndef SYSTEMDPATH | ||
45 | SYSTEMDPATH=usr/lib | ||
46 | endif | ||
47 | -- | ||
48 | 2.7.4 | ||
49 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0013-Always-use-devmapper.patch b/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch index 52240f6439..12811804a3 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0013-Always-use-devmapper.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 1498338970a093fccbda3e33f5588a289ef2c66a Mon Sep 17 00:00:00 2001 | 1 | From d929a1ea5e42ecbe30c990644ed4ada2817c6439 Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
3 | Date: Wed, 5 Jul 2017 02:59:46 -0400 | 3 | Date: Mon, 16 Jul 2018 16:00:14 +0800 |
4 | Subject: [PATCH 13/14] Always use devmapper | 4 | Subject: [PATCH] Always use devmapper |
5 | 5 | ||
6 | Do not try to compute several _API_ make variables | 6 | Do not try to compute several _API_ make variables |
7 | from host information when cross-compiling. | 7 | from host information when cross-compiling. |
@@ -14,12 +14,16 @@ Signed-off-by: Joe Slater <joe.slater@windriver.com> | |||
14 | Rebase to 0.7.1 | 14 | Rebase to 0.7.1 |
15 | 15 | ||
16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
17 | |||
18 | Rebase to 0.7.7 | ||
19 | |||
20 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
17 | --- | 21 | --- |
18 | libmultipath/Makefile | 19 ++++--------------- | 22 | libmultipath/Makefile | 19 ++++--------------- |
19 | 1 file changed, 4 insertions(+), 15 deletions(-) | 23 | 1 file changed, 4 insertions(+), 15 deletions(-) |
20 | 24 | ||
21 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile | 25 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile |
22 | index b3244fc..9006b3f 100644 | 26 | index f51786d..3ad9c48 100644 |
23 | --- a/libmultipath/Makefile | 27 | --- a/libmultipath/Makefile |
24 | +++ b/libmultipath/Makefile | 28 | +++ b/libmultipath/Makefile |
25 | @@ -20,21 +20,10 @@ ifdef SYSTEMD | 29 | @@ -20,21 +20,10 @@ ifdef SYSTEMD |
@@ -49,5 +53,5 @@ index b3244fc..9006b3f 100644 | |||
49 | OBJS = memory.o parser.o vector.o devmapper.o callout.o \ | 53 | OBJS = memory.o parser.o vector.o devmapper.o callout.o \ |
50 | hwtable.o blacklist.o util.o dmparser.o config.o \ | 54 | hwtable.o blacklist.o util.o dmparser.o config.o \ |
51 | -- | 55 | -- |
52 | 2.8.1 | 56 | 2.7.4 |
53 | 57 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0014-Always-use-devmapper-for-kpartx.patch b/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch index f951213c18..88a758dcb7 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0014-Always-use-devmapper-for-kpartx.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 7f5869cd32a7b3f717d9544b35562d9d01ca6510 Mon Sep 17 00:00:00 2001 | 1 | From 145f2b829e5362cda975bebafd7fe4d00ff56d1c Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
3 | Date: Wed, 5 Jul 2017 03:03:16 -0400 | 3 | Date: Mon, 16 Jul 2018 16:02:07 +0800 |
4 | Subject: [PATCH 14/14] Always use devmapper for kpartx | 4 | Subject: [PATCH] Always use devmapper for kpartx |
5 | 5 | ||
6 | Do not try to compute the LIBDM_API_COOKIE make variable | 6 | Do not try to compute the LIBDM_API_COOKIE make variable |
7 | from host information when cross-compiling. | 7 | from host information when cross-compiling. |
@@ -13,12 +13,15 @@ Signed-off-by: Joe Slater <joe.slater@windriver.com> | |||
13 | 13 | ||
14 | Rebase to 0.7.1 | 14 | Rebase to 0.7.1 |
15 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 15 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
16 | |||
17 | Rebase to 0.7.7 | ||
18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
16 | --- | 19 | --- |
17 | kpartx/Makefile | 4 +--- | 20 | kpartx/Makefile | 4 +--- |
18 | 1 file changed, 1 insertion(+), 3 deletions(-) | 21 | 1 file changed, 1 insertion(+), 3 deletions(-) |
19 | 22 | ||
20 | diff --git a/kpartx/Makefile b/kpartx/Makefile | 23 | diff --git a/kpartx/Makefile b/kpartx/Makefile |
21 | index bfa6fe8..be87124 100644 | 24 | index 7eb467e..c143321 100644 |
22 | --- a/kpartx/Makefile | 25 | --- a/kpartx/Makefile |
23 | +++ b/kpartx/Makefile | 26 | +++ b/kpartx/Makefile |
24 | @@ -8,9 +8,7 @@ LDFLAGS += $(BIN_LDFLAGS) | 27 | @@ -8,9 +8,7 @@ LDFLAGS += $(BIN_LDFLAGS) |
@@ -33,5 +36,5 @@ index bfa6fe8..be87124 100644 | |||
33 | OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \ | 36 | OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \ |
34 | gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o | 37 | gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o |
35 | -- | 38 | -- |
36 | 2.8.1 | 39 | 2.7.4 |
37 | 40 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.1.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.7.bb index 6ec5dffcc0..213ce1542e 100644 --- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.1.bb +++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.7.bb | |||
@@ -31,25 +31,42 @@ LICENSE = "GPLv2" | |||
31 | SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \ | 31 | SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \ |
32 | file://multipathd.oe \ | 32 | file://multipathd.oe \ |
33 | file://multipath.conf.example \ | 33 | file://multipath.conf.example \ |
34 | file://0001-multipath-attempt-at-common-multipath.rules.patch \ | 34 | file://0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch \ |
35 | file://0002-RH-fixup-udev-rules-for-redhat.patch \ | 35 | file://0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch \ |
36 | file://0003-RH-Remove-the-property-blacklist-exception-builtin.patch \ | 36 | file://0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch \ |
37 | file://0004-RH-don-t-start-without-a-config-file.patch \ | 37 | file://0004-multipath-tools-replace-FSF-address-with-a-www-point.patch \ |
38 | file://0005-RH-add-mpathconf.patch \ | 38 | file://0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch \ |
39 | file://0006-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch \ | 39 | file://0006-multipath-tools-fix-compilation-with-musl-libc.patch \ |
40 | file://0007-RH-trigger-change-uevent-on-new-device-creation.patch \ | 40 | file://0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch \ |
41 | file://0008-libmultipath-change-how-RADOS-checker-is-enabled.patch \ | 41 | file://0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch \ |
42 | file://0009-multipath-set-verbosity-to-default-during-config.patch \ | 42 | file://0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch \ |
43 | file://0010-mpath-skip-device-configs-without-vendor-product.patch \ | 43 | file://0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch \ |
44 | file://0011-multipathd-fix-show-maps-json-crash.patch \ | 44 | file://0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch \ |
45 | file://0012-multipath-tools-modify-Makefile.inc-for-cross-compil.patch \ | 45 | file://0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch \ |
46 | file://0013-Always-use-devmapper.patch \ | 46 | file://0013-libmultipath-print-correct-default-for-delay_-_check.patch \ |
47 | file://0014-Always-use-devmapper-for-kpartx.patch \ | 47 | file://0014-multipath.conf.5-clarify-property-whitelist-handling.patch \ |
48 | file://0001-kpartx-include-limits.h-for-PATH_MAX.patch \ | 48 | file://0015-mpathpersist-add-all_tg_pt-option.patch \ |
49 | file://0016-libmultipath-remove-rbd-code.patch \ | ||
50 | file://0017-mpathpersist-fix-aptpl-support.patch \ | ||
51 | file://0018-multipath-don-t-check-timestamps-without-a-path.patch \ | ||
52 | file://0019-libmultipath-fix-detect-alua-corner-case.patch \ | ||
53 | file://0020-multipath-fix-setting-conf-version.patch \ | ||
54 | file://0021-RH-fixup-udev-rules-for-redhat.patch \ | ||
55 | file://0022-RH-Remove-the-property-blacklist-exception-builtin.patch \ | ||
56 | file://0023-RH-don-t-start-without-a-config-file.patch \ | ||
57 | file://0024-RH-use-rpm-optflags-if-present.patch \ | ||
58 | file://0025-RH-add-mpathconf.patch \ | ||
59 | file://0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch \ | ||
60 | file://0027-RH-warn-on-invalid-regex-instead-of-failing.patch \ | ||
61 | file://0028-RH-reset-default-find_mutipaths-value-to-off.patch \ | ||
62 | file://0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch \ | ||
63 | file://0030-Always-use-devmapper.patch \ | ||
64 | file://0031-Always-use-devmapper-for-kpartx.patch \ | ||
49 | " | 65 | " |
66 | |||
50 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" | 67 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" |
51 | 68 | ||
52 | SRCREV = "f21166a812a2cfb50ecf9550d32947c83103f83a" | 69 | SRCREV = "386d288b5595fc2c01dffe698b6eb306c6674908" |
53 | 70 | ||
54 | S = "${WORKDIR}/git" | 71 | S = "${WORKDIR}/git" |
55 | 72 | ||