From: Martin Schwenke Date: Tue, 29 Oct 2019 06:28:22 +0000 (+1100) Subject: ctdb-tcp: Drop tracking of file descriptor for incoming connections X-Git-Tag: samba-4.9.16~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dcb2efb8f828606d22742100491fb7b8f61a340;p=thirdparty%2Fsamba.git ctdb-tcp: Drop tracking of file descriptor for incoming connections This file descriptor is owned by the incoming queue. It will be closed when the queue is torn down. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit bf47bc18bb8a94231870ef821c0352b7a15c2e28) --- diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h index 9a615fc6393..daabad74297 100644 --- a/ctdb/tcp/ctdb_tcp.h +++ b/ctdb/tcp/ctdb_tcp.h @@ -37,7 +37,6 @@ struct ctdb_tcp_node { struct tevent_timer *connect_te; struct ctdb_context *ctdb; - int in_fd; struct ctdb_queue *in_queue; }; diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index a30ee23cf7c..0b5d021480a 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -355,8 +355,6 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde, return; } - tnode->in_fd = fd; - /* * Mark the connecting node as connected, but only if the * corresponding outbound connected is also up diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c index 91d4e992c8f..20ad260929b 100644 --- a/ctdb/tcp/tcp_init.c +++ b/ctdb/tcp/tcp_init.c @@ -43,11 +43,6 @@ static int tnode_destructor(struct ctdb_tcp_node *tnode) tnode->out_fd = -1; } - if (tnode->in_fd != -1) { - close(tnode->in_fd); - tnode->in_fd = -1; - } - return 0; } @@ -61,7 +56,6 @@ static int ctdb_tcp_add_node(struct ctdb_node *node) CTDB_NO_MEMORY(node->ctdb, tnode); tnode->out_fd = -1; - tnode->in_fd = -1; tnode->ctdb = node->ctdb; node->private_data = tnode; diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index e8ebff887e1..2d8ec0f7062 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -76,8 +76,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args) failed: TALLOC_FREE(tnode->in_queue); - close(tnode->in_fd); - tnode->in_fd = -1; node->ctdb->upcalls->node_dead(node); TALLOC_FREE(data);