From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [DLM PATCH 1/6] DLM: Don't create kernel socket until we have valid node address
Date: Wed, 10 Feb 2016 13:55:27 -0500 [thread overview]
Message-ID: <1455130532-9317-2-git-send-email-rpeterso@redhat.com> (raw)
In-Reply-To: <1455130532-9317-1-git-send-email-rpeterso@redhat.com>
The idea here is to not create a kernel socket until we know we
have a valid node address. That's how it's done in the sctp version.
This patch changes function tcp_connect_to_sock to match the sctp
function more closely.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
fs/dlm/lowcomms.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index dc9ae6d..977c73b 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1087,12 +1087,6 @@ static void tcp_connect_to_sock(struct connection *con)
if (con->sock)
goto out;
- /* Create a socket to communicate with */
- result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
- SOCK_STREAM, IPPROTO_TCP, &sock);
- if (result < 0)
- goto out_err;
-
memset(&saddr, 0, sizeof(saddr));
result = nodeid_to_addr(con->nodeid, &saddr, NULL, false);
if (result < 0) {
@@ -1100,6 +1094,12 @@ static void tcp_connect_to_sock(struct connection *con)
goto out_err;
}
+ /* Create a socket to communicate with */
+ result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
+ SOCK_STREAM, IPPROTO_TCP, &sock);
+ if (result < 0)
+ goto out_err;
+
sock->sk->sk_user_data = con;
con->rx_action = receive_from_sock;
con->connect_action = tcp_connect_to_sock;
--
2.5.0
next prev parent reply other threads:[~2016-02-10 18:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 18:55 [Cluster-devel] [DLM PATCH 0/6] Misc DLM Improvements Regarding Socket Errors Bob Peterson
2016-02-10 18:55 ` Bob Peterson [this message]
2016-02-10 18:55 ` [Cluster-devel] [DLM PATCH 2/6] DLM: Call original error report when socket is NULL Bob Peterson
2016-02-11 16:43 ` Andreas Gruenbacher
2016-02-10 18:55 ` [Cluster-devel] [DLM PATCH 3/6] DLM: Make consistent error path through tcp_create_listen_sock Bob Peterson
2016-02-11 16:52 ` Andreas Gruenbacher
2016-02-11 17:59 ` Bob Peterson
2016-02-11 21:09 ` [Cluster-devel] [DLM PATCH 3/6] DLM: Make consistent error path Andreas Gruenbacher
2016-02-10 18:55 ` [Cluster-devel] [DLM PATCH 4/6] DLM: Eliminate useless goto Bob Peterson
2016-02-11 16:53 ` Andreas Gruenbacher
2016-02-10 18:55 ` [Cluster-devel] [DLM PATCH 5/6] DLM: Add locking to protect save callback assignments Bob Peterson
2016-02-11 17:04 ` Andreas Gruenbacher
2016-02-10 18:55 ` [Cluster-devel] [DLM PATCH 6/6] DLM: save / restore all socket callbacks Bob Peterson
2016-02-11 15:31 ` Steven Whitehouse
2016-02-11 16:43 ` [Cluster-devel] [DLM PATCH 6/6][try #2] " Bob Peterson
2016-02-11 17:10 ` Andreas Gruenbacher
2016-02-11 17:05 ` [Cluster-devel] [DLM PATCH 0/6] Misc DLM Improvements Regarding Socket Errors Andreas Gruenbacher
2016-02-11 17:22 ` David Teigland
2016-02-11 18:39 ` Bob Peterson
2016-02-11 18:59 ` David Teigland
2016-02-15 21:16 ` Bob Peterson
2016-02-15 21:24 ` David Teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455130532-9317-2-git-send-email-rpeterso@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).