From: Bob Peterson Date: Thu, 11 Feb 2016 12:59:10 -0500 (EST) Subject: [Cluster-devel] [DLM PATCH 3/6] DLM: Make consistent error path through tcp_create_listen_sock In-Reply-To: References: <1455130532-9317-1-git-send-email-rpeterso@redhat.com> <1455130532-9317-4-git-send-email-rpeterso@redhat.com> Message-ID: <1144926957.21868310.1455213550925.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > > +out_err: > > + sock_release(sock); > > + sock = NULL; > > + con->sock = NULL; > > Consolidating the error paths makes sense, but con->sock shouldn't be > set here at all; the caller does that in add_sock(). > > Thanks, > Andreas > Hi Andreas, I disagree. The caller doesn't call add_sock() in the error case, which is where we're setting con->sock to NULL. Instead, it returns -EADDRINUSE to its caller, dlm_lowcomms_start, which jumps to label fail_unlisten, which calls close_connection for the con if it finds it for nodeid 0, then it calls close_connection for it, which does some things if con->sock is not NULL. That path through the code is hard to follow, so maybe I'm wrong. Regards, Bob Peterson Red Hat File Systems