From b9e7a16f8521e89bb726ea4d268bcec2de32164c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 13 Aug 2019 21:42:15 +1000 Subject: [PATCH] ctdb-tools: Stop deleted nodes from influencing ctdb nodestatus exit code Deleted nodes should simply be ignored. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14129 RN: Stop deleted nodes from influencing ctdb nodestatus exit code Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 32b5ceb31936ec5447362236c1809db003561d29) --- ctdb/tools/ctdb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 2cc72eedc76..6a15b61ccd1 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5611,7 +5611,13 @@ static int control_nodestatus(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, ret = 0; for (i=0; inum; i++) { - ret |= nodemap->node[i].flags; + uint32_t flags = nodemap->node[i].flags; + + if ((flags & NODE_FLAGS_DELETED) != 0) { + continue; + } + + ret |= flags; } return ret; -- 2.23.0