diff options
author | Martin Schwenke <martin@meltin.net> | 2020-07-30 11:57:51 +1000 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-08-25 11:27:18 +0000 |
commit | 4aae8adc7182687db73c2e40b4a8a24ce5053d16 (patch) | |
tree | 7011cb6ac1972dc45b2e10a17ecbf93b8be0ec97 /ctdb | |
parent | ad9780853ed3a18993fa0935ea4551716030b8e2 (diff) | |
download | samba-4aae8adc7182687db73c2e40b4a8a24ce5053d16.tar.gz |
ctdb-recoverd: Fix node_pnn check and assignment of nodemap into array
This array is indexed by the same index as nodemap, not the PNN.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 368c83bfe3bbfff568d14f65e7b1ffa41d5349ac)
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_recoverd.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index e50facfe992..b910aacce7c 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -2237,13 +2237,21 @@ static void async_getnodemap_callback(struct ctdb_context *ctdb, struct remote_nodemaps_state *state = (struct remote_nodemaps_state *)callback_data; struct ctdb_node_map_old **remote_nodemaps = state->remote_nodemaps; + struct ctdb_node_map_old *nodemap = state->rec->nodemap; + size_t i; - if (node_pnn >= ctdb->num_nodes) { - DBG_ERR("Invalid PNN\n"); + for (i = 0; i < nodemap->num; i++) { + if (nodemap->nodes[i].pnn == node_pnn) { + break; + } + } + + if (i >= nodemap->num) { + DBG_ERR("Invalid PNN %"PRIu32"\n", node_pnn); return; } - remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal( + remote_nodemaps[i] = (struct ctdb_node_map_old *)talloc_steal( remote_nodemaps, outdata.dptr); } |