mirror of
https://github.com/samba-team/samba.git
synced 2025-09-04 09:44:20 +03:00
We dont need to serialize the "probe which address this node is" if we have given an explicit --node-ip on the commandline
(This used to be ctdb commit e3dc5bd3f1ef1f0ed08f57a5b5bafcac936e9ed0)
This commit is contained in:
@@ -281,6 +281,8 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
|
|||||||
int sock_size;
|
int sock_size;
|
||||||
struct tevent_fd *fde;
|
struct tevent_fd *fde;
|
||||||
|
|
||||||
|
/* We only need to serialize this if we dont yet know the node ip */
|
||||||
|
if (!ctdb->node_ip) {
|
||||||
/* in order to ensure that we don't get two nodes with the
|
/* in order to ensure that we don't get two nodes with the
|
||||||
same adddress, we must make the bind() and listen() calls
|
same adddress, we must make the bind() and listen() calls
|
||||||
atomic. The SO_REUSEADDR setsockopt only prevents double
|
atomic. The SO_REUSEADDR setsockopt only prevents double
|
||||||
@@ -302,6 +304,7 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
|
|||||||
close(lock_fd);
|
close(lock_fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0; i < ctdb->num_nodes; i++) {
|
for (i=0; i < ctdb->num_nodes; i++) {
|
||||||
if (ctdb->nodes[i]->flags & NODE_FLAGS_DELETED) {
|
if (ctdb->nodes[i]->flags & NODE_FLAGS_DELETED) {
|
||||||
@@ -399,11 +402,15 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
|
|||||||
ctdb_listen_event, ctdb);
|
ctdb_listen_event, ctdb);
|
||||||
tevent_fd_set_auto_close(fde);
|
tevent_fd_set_auto_close(fde);
|
||||||
|
|
||||||
|
if (!ctdb->node_ip) {
|
||||||
close(lock_fd);
|
close(lock_fd);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
if (!ctdb->node_ip) {
|
||||||
close(lock_fd);
|
close(lock_fd);
|
||||||
|
}
|
||||||
close(ctcp->listen_fd);
|
close(ctcp->listen_fd);
|
||||||
ctcp->listen_fd = -1;
|
ctcp->listen_fd = -1;
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user