1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-recoverd: Basic cleanups for get_remote_nodemaps()

Don't log an error on failure - let the caller can do this.  Apart
from this: fix up coding style and modernise the remaining error
message.

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>
This commit is contained in:
Martin Schwenke 2018-01-18 16:19:36 +11:00 committed by Amitay Isaacs
parent 20606fd0a4
commit 52f520d39c

View File

@ -2223,38 +2223,45 @@ done:
}
static void async_getnodemap_callback(struct ctdb_context *ctdb, uint32_t node_pnn, int32_t res, TDB_DATA outdata, void *callback_data)
static void async_getnodemap_callback(struct ctdb_context *ctdb,
uint32_t node_pnn,
int32_t res,
TDB_DATA outdata,
void *callback_data)
{
struct ctdb_node_map_old **remote_nodemaps = callback_data;
if (node_pnn >= ctdb->num_nodes) {
DEBUG(DEBUG_ERR,(__location__ " pnn from invalid node\n"));
DBG_ERR("Invalid PNN\n");
return;
}
remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal(remote_nodemaps, outdata.dptr);
remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal(
remote_nodemaps, outdata.dptr);
}
static int get_remote_nodemaps(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
struct ctdb_node_map_old *nodemap,
struct ctdb_node_map_old **remote_nodemaps)
static int get_remote_nodemaps(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct ctdb_node_map_old *nodemap,
struct ctdb_node_map_old **remote_nodemaps)
{
uint32_t *nodes;
int ret;
nodes = list_of_active_nodes(ctdb, nodemap, mem_ctx, true);
if (ctdb_client_async_control(ctdb, CTDB_CONTROL_GET_NODEMAP,
nodes, 0,
CONTROL_TIMEOUT(), false, tdb_null,
ret = ctdb_client_async_control(ctdb,
CTDB_CONTROL_GET_NODEMAP,
nodes,
0,
CONTROL_TIMEOUT(),
false,
tdb_null,
async_getnodemap_callback,
NULL,
remote_nodemaps) != 0) {
DEBUG(DEBUG_ERR, (__location__ " Unable to pull all remote nodemaps\n"));
return -1;
}
return 0;
remote_nodemaps);
return ret;
}
static bool validate_recovery_master(struct ctdb_recoverd *rec,