diff options
author | Christine Caulfield <ccaulfie@redhat.com> | 2009-05-07 11:54:16 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2009-05-15 10:34:12 -0400 |
commit | 391fbdc5d527149578490db2f1619951d91f3561 (patch) | |
tree | 98b84ba8cd459293a232fd148cef0886f976bf19 /fs/dlm/lowcomms.c | |
parent | 8511a2728ab82cab398e39d019f5cf1246021c1c (diff) |
dlm: connect to nodes earlier
Make network connections to other nodes earlier, in the context of
dlm_recoverd. This avoids connecting to nodes from dlm_send where we
try to avoid allocations which could possibly deadlock if memory reclaim
goes into the cluster fs which may try to do a dlm operation.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lowcomms.c')
-rw-r--r-- | fs/dlm/lowcomms.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 609108a83267..2559a97f0ddc 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -309,6 +309,20 @@ static void lowcomms_state_change(struct sock *sk) | |||
309 | lowcomms_write_space(sk); | 309 | lowcomms_write_space(sk); |
310 | } | 310 | } |
311 | 311 | ||
312 | int dlm_lowcomms_connect_node(int nodeid) | ||
313 | { | ||
314 | struct connection *con; | ||
315 | |||
316 | if (nodeid == dlm_our_nodeid()) | ||
317 | return 0; | ||
318 | |||
319 | con = nodeid2con(nodeid, GFP_NOFS); | ||
320 | if (!con) | ||
321 | return -ENOMEM; | ||
322 | lowcomms_connect_sock(con); | ||
323 | return 0; | ||
324 | } | ||
325 | |||
312 | /* Make a socket active */ | 326 | /* Make a socket active */ |
313 | static int add_sock(struct socket *sock, struct connection *con) | 327 | static int add_sock(struct socket *sock, struct connection *con) |
314 | { | 328 | { |
@@ -1421,7 +1435,7 @@ static int work_start(void) | |||
1421 | static void stop_conn(struct connection *con) | 1435 | static void stop_conn(struct connection *con) |
1422 | { | 1436 | { |
1423 | con->flags |= 0x0F; | 1437 | con->flags |= 0x0F; |
1424 | if (con->sock) | 1438 | if (con->sock && con->sock->sk) |
1425 | con->sock->sk->sk_user_data = NULL; | 1439 | con->sock->sk->sk_user_data = NULL; |
1426 | } | 1440 | } |
1427 | 1441 | ||