buf = named_prepare_buf(PUBLICATION, ITEM_SIZE, 0);
if (!buf) {
- warn("Publication distribution failure\n");
+ warn("Memory squeeze; failed to distribute publication\n");
return;
}
buf = named_prepare_buf(WITHDRAWAL, ITEM_SIZE, 0);
if (!buf) {
- warn("Withdrawl distribution failure\n");
+ warn("Memory squeeze; failed to distribute withdrawal\n");
return;
}
void tipc_named_node_up(unsigned long node)
{
struct publication *publ;
- struct distr_item *item = NULL;
- struct sk_buff *buf = NULL;
+ struct distr_item *item = 0;
+ struct sk_buff *buf = 0;
u32 left = 0;
u32 rest;
u32 max_item_buf;
+ assert(in_own_cluster(node));
read_lock_bh(&tipc_nametbl_lock);
max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
max_item_buf *= ITEM_SIZE;
left = (rest <= max_item_buf) ? rest : max_item_buf;
rest -= left;
buf = named_prepare_buf(PUBLICATION, left, node);
- if (!buf) {
- warn("Bulk publication distribution failure\n");
+ if (buf == NULL) {
+ warn("Memory Squeeze; could not send publication\n");
goto exit;
}
item = (struct distr_item *)msg_data(buf_msg(buf));
"<%u.%u.%u>\n", tipc_zone(node),
tipc_cluster(node), tipc_node(node));
tipc_link_send(buf, node, node);
- buf = NULL;
+ buf = 0;
}
}
exit:
static void node_is_down(struct publication *publ)
{
struct publication *p;
-
write_lock_bh(&tipc_nametbl_lock);
dbg("node_is_down: withdrawing %u, %u, %u\n",
publ->type, publ->lower, publ->upper);
publ->key += 1222345;
p = tipc_nametbl_remove_publ(publ->type, publ->lower,
publ->node, publ->ref, publ->key);
+ assert(p == publ);
write_unlock_bh(&tipc_nametbl_lock);
-
- if (p != publ) {
- err("Unable to remove publication from failed node\n"
- "(type=%u, lower=%u, node=0x%x, ref=%u, key=%u)\n",
- publ->type, publ->lower, publ->node, publ->ref, publ->key);
- }
-
- if (p) {
- kfree(p);
- }
+ if (publ)
+ kfree(publ);
}
/**
if (publ) {
tipc_nodesub_unsubscribe(&publ->subscr);
kfree(publ);
- } else {
- err("Unable to remove publication by node 0x%x\n"
- "(type=%u, lower=%u, ref=%u, key=%u)\n",
- msg_orignode(msg),
- ntohl(item->type), ntohl(item->lower),
- ntohl(item->ref), ntohl(item->key));
}
} else {
- warn("Unrecognized name table message received\n");
+ warn("tipc_named_recv: unknown msg\n");
}
item++;
}