]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tcp: Drop tracking of file descriptor for incoming connections
authorMartin Schwenke <martin@meltin.net>
Tue, 29 Oct 2019 06:28:22 +0000 (17:28 +1100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 Nov 2019 11:15:25 +0000 (11:15 +0000)
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit bf47bc18bb8a94231870ef821c0352b7a15c2e28)

ctdb/tcp/ctdb_tcp.h
ctdb/tcp/tcp_connect.c
ctdb/tcp/tcp_init.c
ctdb/tcp/tcp_io.c

index 9a615fc6393d494349a732abe86fd9ac0f88c2f9..daabad74297e2e2168228a6d531b227f11841354 100644 (file)
@@ -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;
 };
 
index a30ee23cf7c1f745e93bb56a21002cff10e6d9b6..0b5d021480ad901bd8e16f2fd562b34960423e5d 100644 (file)
@@ -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
index 91d4e992c8f39c996da32723969d5a625d191884..20ad260929b1d4c9958a151abbaaaa5b9023b6d3 100644 (file)
@@ -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;
index e8ebff887e13a93f948d380d2d6bdd2a12777e28..2d8ec0f706219ab6370bafacfd0ef56d20b9f0d6 100644 (file)
@@ -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);