mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-recoverd: Correctly find nodemap entry for pnn
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
9475ab0441
commit
3654e41677
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user