struct connection *con;
down(&connections_lock);
- for (i=0; i<max_nodeid; i++) {
+ for (i=0; i<=max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con && con->sctp_assoc == assoc_id) {
up(&connections_lock);
parg.associd = sn->sn_assoc_change.sac_assoc_id;
ret = kernel_getsockopt(con->sock, IPPROTO_SCTP, SCTP_SOCKOPT_PEELOFF,
(void *)&parg, &parglen);
- if (ret < 0) {
+ if (ret) {
log_print("Can't peel off a socket for connection %d to node %d: err=%d\n",
parg.associd, nodeid, ret);
- return;
}
-
file = fget(parg.sd);
new_con->sock = SOCKET_I(file->f_dentry->d_inode);
add_sock(new_con->sock, new_con);
/* Process SCTP notifications */
if (msg.msg_flags & MSG_NOTIFICATION) {
- BUG_ON(con->nodeid != 0);
msg.msg_control = incmsg;
msg.msg_controllen = sizeof(incmsg);
struct sockaddr_storage sas, *addr;
int i;
+ dlm_local_count = 0;
for (i = 0; i < DLM_MAX_ADDR_COUNT - 1; i++) {
if (dlm_our_addr(&sas, i))
break;
{
int nodeid;
- for (nodeid = 1; nodeid < max_nodeid; nodeid++) {
- struct connection *con = nodeid2con(nodeid, 0);
+ for (nodeid = 1; nodeid <= max_nodeid; nodeid++) {
+ struct connection *con = __nodeid2con(nodeid, 0);
if (con)
clean_one_writequeue(con);
socket activity.
*/
down(&connections_lock);
- for (i = 0; i < max_nodeid; i++) {
+ for (i = 0; i <= max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con)
con->flags |= 0xFF;
down(&connections_lock);
clean_writequeues();
- for (i = 0; i < max_nodeid; i++) {
+ for (i = 0; i <= max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con) {
close_connection(con, true);
kmem_cache_free(con_cache, con);
}
}
+ max_nodeid = 0;
up(&connections_lock);
kmem_cache_destroy(con_cache);
+ idr_init(&connections_idr);
}
int dlm_lowcomms_start(void)