]> git.proxmox.com Git - corosync-pve.git/blob - patches/0008-cherry-pick-totem-config-patches-for-no-link0-setups.patch
buildsys: fix source tarball generation directory level one-off
[corosync-pve.git] / patches / 0008-cherry-pick-totem-config-patches-for-no-link0-setups.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 Date: Fri, 21 Jun 2019 14:19:44 +0200
4 Subject: [PATCH] cherry-pick totem config patches for no link0 setups
5
6 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 ---
8 debian/patches/series | 2 +
9 ...if-all-nodes-have-name-attrs-in-mult.patch | 48 +++++++++++++++++++
10 ...if-all-nodes-have-same-number-of-lin.patch | 40 ++++++++++++++++
11 3 files changed, 90 insertions(+)
12 create mode 100644 debian/patches/totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
13 create mode 100644 debian/patches/totem-fix-check-if-all-nodes-have-same-number-of-lin.patch
14
15 diff --git a/debian/patches/series b/debian/patches/series
16 index 36735b84..5c91cd38 100644
17 --- a/debian/patches/series
18 +++ b/debian/patches/series
19 @@ -57,3 +57,5 @@ cpg-send-single-confchg-event-per-group-on-joinlist.patch
20 cpg-Add-more-comments-to-notify_lib_joinlist.patch
21 cpg-Move-filling-of-member_list-to-subfunction.patch
22 bump-version-to-3.0.2.patch
23 +totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
24 +totem-fix-check-if-all-nodes-have-same-number-of-lin.patch
25 diff --git a/debian/patches/totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch b/debian/patches/totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
26 new file mode 100644
27 index 00000000..9a6cc3ab
28 --- /dev/null
29 +++ b/debian/patches/totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
30 @@ -0,0 +1,48 @@
31 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
32 +From: Thomas Lamprecht <t.lamprecht@proxmox.com>
33 +Date: Fri, 14 Jun 2019 18:31:16 +0200
34 +Subject: [PATCH] totem: fix check if all nodes have name attrs in multi-link
35 + setups
36 +
37 +As totem_config->interfaces entries are _all_ possible links and not
38 +only the configured ones we cannot trust that interface[0] is
39 +configured at the time of checking, and thus has a valid
40 +member_count. So set the members variable to the member_count entry
41 +from an actually configured interface and loop over that one.
42 +
43 +This fixes a case where the check for the name property on all nodes
44 +for multi links was skipped if link 0 was not configured, as then its
45 +member_count was 0.
46 +
47 +Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
48 +Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
49 +Reviewed-by: Jan Friesse <jfriesse@redhat.com>
50 +(cherry picked from commit 7ada508a82680dcf23510e585ec295b10ac5da11)
51 +Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
52 +---
53 + exec/totemconfig.c | 7 ++++---
54 + 1 file changed, 4 insertions(+), 3 deletions(-)
55 +
56 +diff --git a/exec/totemconfig.c b/exec/totemconfig.c
57 +index d57562ae..0c2b5320 100644
58 +--- a/exec/totemconfig.c
59 ++++ b/exec/totemconfig.c
60 +@@ -388,14 +388,15 @@ static int totem_volatile_config_validate (
61 + num_configured = 0;
62 + for (i = 0; i < INTERFACE_MAX; i++) {
63 + if (totem_config->interfaces[i].configured) {
64 ++ if (num_configured == 0) {
65 ++ members = totem_config->interfaces[i].member_count;
66 ++ }
67 + num_configured++;
68 + }
69 + }
70 +
71 + if (num_configured > 1) {
72 +- members = totem_config->interfaces[0].member_count;
73 +-
74 +- for (i=0; i<totem_config->interfaces[0].member_count; i++) {
75 ++ for (i=0; i < members; i++) {
76 + snprintf(name_key, sizeof(name_key), "nodelist.node.%d.name", i);
77 +
78 + if (icmap_get_string(name_key, &name_str) != CS_OK) {
79 diff --git a/debian/patches/totem-fix-check-if-all-nodes-have-same-number-of-lin.patch b/debian/patches/totem-fix-check-if-all-nodes-have-same-number-of-lin.patch
80 new file mode 100644
81 index 00000000..2f061de5
82 --- /dev/null
83 +++ b/debian/patches/totem-fix-check-if-all-nodes-have-same-number-of-lin.patch
84 @@ -0,0 +1,40 @@
85 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
86 +From: Thomas Lamprecht <t.lamprecht@proxmox.com>
87 +Date: Fri, 14 Jun 2019 18:56:57 +0200
88 +Subject: [PATCH] totem: fix check if all nodes have same number of links
89 +
90 +configured links may not come in order in the interfaces array, which
91 +holds an entry for _all_ possible links, not just configured ones.
92 +
93 +So iterate through all interfaces, but skip those which are not
94 +configured. This allows to start corosync with a configuration where
95 +link 0 is currently not mentioned, as else it was checked but had
96 +member_count = 0 from it's default initialization, which then made
97 +this code report a false positive for the "Not all nodes have the
98 +same number of links" check even on a correct config.
99 +
100 +Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
101 +Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
102 +Reviewed-by: Jan Friesse <jfriesse@redhat.com>
103 +(cherry picked from commit 816324c94cfb917b11f43954b8757424db28b390)
104 +Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
105 +---
106 + exec/totemconfig.c | 5 ++++-
107 + 1 file changed, 4 insertions(+), 1 deletion(-)
108 +
109 +diff --git a/exec/totemconfig.c b/exec/totemconfig.c
110 +index 0c2b5320..d2b3ed72 100644
111 +--- a/exec/totemconfig.c
112 ++++ b/exec/totemconfig.c
113 +@@ -406,7 +406,10 @@ static int totem_volatile_config_validate (
114 + }
115 + }
116 +
117 +- for (i=0; i<num_configured; i++) {
118 ++ for (i=0; i < INTERFACE_MAX; i++) {
119 ++ if (!totem_config->interfaces[i].configured) {
120 ++ continue;
121 ++ }
122 + if (totem_config->interfaces[i].member_count != members) {
123 + snprintf (local_error_reason, sizeof(local_error_reason),
124 + "Not all nodes have the same number of links");
125 --
126 2.20.1
127