summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2020-07-14 14:22:15 +1000
committerKarolin Seeger <kseeger@samba.org>2020-08-25 13:57:28 +0000
commitd8e6304a2bda438194b685411fa0896f26c4b896 (patch)
treed73d48eaa2944fe421729be81f45503bb9511349 /ctdb
parent94a9842af6c65c360053f21680c9da862f8338c5 (diff)
downloadsamba-d8e6304a2bda438194b685411fa0896f26c4b896.tar.gz
ctdb-recoverd: Correctly find nodemap entry for pnn
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 3654e416770cc7521dcc3c15976daeba37023304)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_recoverd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 049b6841714..a480f7fa90e 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -438,18 +438,24 @@ static int update_flags_on_all_nodes(struct ctdb_recoverd *rec,
struct ctdb_node_flag_change c;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
uint32_t *nodes;
+ uint32_t i;
int ret;
nodemap = rec->nodemap;
- if (pnn >= nodemap->num) {
+ for (i = 0; i < nodemap->num; i++) {
+ if (pnn == nodemap->nodes[i].pnn) {
+ break;
+ }
+ }
+ if (i >= nodemap->num) {
DBG_ERR("Nodemap does not contain node %d\n", pnn);
talloc_free(tmp_ctx);
return -1;
}
c.pnn = pnn;
- c.old_flags = nodemap->nodes[pnn].flags;
+ c.old_flags = nodemap->nodes[i].flags;
c.new_flags = c.old_flags;
c.new_flags |= flags;
c.new_flags &= flags;