aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/tcp.c')
-rw-r--r--fs/ocfs2/cluster/tcp.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 35d92c01a972..0f60cc0d3985 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1285,14 +1285,16 @@ static void o2net_idle_timer(unsigned long data)
1285 mlog(ML_NOTICE, "here are some times that might help debug the " 1285 mlog(ML_NOTICE, "here are some times that might help debug the "
1286 "situation: (tmr %ld.%ld now %ld.%ld dr %ld.%ld adv " 1286 "situation: (tmr %ld.%ld now %ld.%ld dr %ld.%ld adv "
1287 "%ld.%ld:%ld.%ld func (%08x:%u) %ld.%ld:%ld.%ld)\n", 1287 "%ld.%ld:%ld.%ld func (%08x:%u) %ld.%ld:%ld.%ld)\n",
1288 sc->sc_tv_timer.tv_sec, sc->sc_tv_timer.tv_usec, 1288 sc->sc_tv_timer.tv_sec, (long) sc->sc_tv_timer.tv_usec,
1289 now.tv_sec, now.tv_usec, 1289 now.tv_sec, (long) now.tv_usec,
1290 sc->sc_tv_data_ready.tv_sec, sc->sc_tv_data_ready.tv_usec, 1290 sc->sc_tv_data_ready.tv_sec, (long) sc->sc_tv_data_ready.tv_usec,
1291 sc->sc_tv_advance_start.tv_sec, sc->sc_tv_advance_start.tv_usec, 1291 sc->sc_tv_advance_start.tv_sec,
1292 sc->sc_tv_advance_stop.tv_sec, sc->sc_tv_advance_stop.tv_usec, 1292 (long) sc->sc_tv_advance_start.tv_usec,
1293 sc->sc_tv_advance_stop.tv_sec,
1294 (long) sc->sc_tv_advance_stop.tv_usec,
1293 sc->sc_msg_key, sc->sc_msg_type, 1295 sc->sc_msg_key, sc->sc_msg_type,
1294 sc->sc_tv_func_start.tv_sec, sc->sc_tv_func_start.tv_usec, 1296 sc->sc_tv_func_start.tv_sec, (long) sc->sc_tv_func_start.tv_usec,
1295 sc->sc_tv_func_stop.tv_sec, sc->sc_tv_func_stop.tv_usec); 1297 sc->sc_tv_func_stop.tv_sec, (long) sc->sc_tv_func_stop.tv_usec);
1296 1298
1297 o2net_sc_queue_work(sc, &sc->sc_shutdown_work); 1299 o2net_sc_queue_work(sc, &sc->sc_shutdown_work);
1298} 1300}
@@ -1316,7 +1318,7 @@ static void o2net_start_connect(void *arg)
1316{ 1318{
1317 struct o2net_node *nn = arg; 1319 struct o2net_node *nn = arg;
1318 struct o2net_sock_container *sc = NULL; 1320 struct o2net_sock_container *sc = NULL;
1319 struct o2nm_node *node = NULL; 1321 struct o2nm_node *node = NULL, *mynode = NULL;
1320 struct socket *sock = NULL; 1322 struct socket *sock = NULL;
1321 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, }; 1323 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };
1322 int ret = 0; 1324 int ret = 0;
@@ -1332,6 +1334,12 @@ static void o2net_start_connect(void *arg)
1332 goto out; 1334 goto out;
1333 } 1335 }
1334 1336
1337 mynode = o2nm_get_node_by_num(o2nm_this_node());
1338 if (mynode == NULL) {
1339 ret = 0;
1340 goto out;
1341 }
1342
1335 spin_lock(&nn->nn_lock); 1343 spin_lock(&nn->nn_lock);
1336 /* see if we already have one pending or have given up */ 1344 /* see if we already have one pending or have given up */
1337 if (nn->nn_sc || nn->nn_persistent_error) 1345 if (nn->nn_sc || nn->nn_persistent_error)
@@ -1359,12 +1367,14 @@ static void o2net_start_connect(void *arg)
1359 sock->sk->sk_allocation = GFP_ATOMIC; 1367 sock->sk->sk_allocation = GFP_ATOMIC;
1360 1368
1361 myaddr.sin_family = AF_INET; 1369 myaddr.sin_family = AF_INET;
1370 myaddr.sin_addr.s_addr = (__force u32)mynode->nd_ipv4_address;
1362 myaddr.sin_port = (__force u16)htons(0); /* any port */ 1371 myaddr.sin_port = (__force u16)htons(0); /* any port */
1363 1372
1364 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, 1373 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
1365 sizeof(myaddr)); 1374 sizeof(myaddr));
1366 if (ret) { 1375 if (ret) {
1367 mlog(0, "bind failed: %d\n", ret); 1376 mlog(ML_ERROR, "bind failed with %d at address %u.%u.%u.%u\n",
1377 ret, NIPQUAD(mynode->nd_ipv4_address));
1368 goto out; 1378 goto out;
1369 } 1379 }
1370 1380
@@ -1405,6 +1415,8 @@ out:
1405 sc_put(sc); 1415 sc_put(sc);
1406 if (node) 1416 if (node)
1407 o2nm_node_put(node); 1417 o2nm_node_put(node);
1418 if (mynode)
1419 o2nm_node_put(mynode);
1408 1420
1409 return; 1421 return;
1410} 1422}