aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/masklog.c1
-rw-r--r--fs/ocfs2/cluster/masklog.h2
-rw-r--r--fs/ocfs2/cluster/nodemanager.c4
-rw-r--r--fs/ocfs2/cluster/tcp.c14
-rw-r--r--fs/ocfs2/cluster/tcp.h5
5 files changed, 17 insertions, 9 deletions
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index fd741cea5705..636593bf4d17 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -74,6 +74,7 @@ struct mlog_attribute {
74#define define_mask(_name) { \ 74#define define_mask(_name) { \
75 .attr = { \ 75 .attr = { \
76 .name = #_name, \ 76 .name = #_name, \
77 .owner = THIS_MODULE, \
77 .mode = S_IRUGO | S_IWUSR, \ 78 .mode = S_IRUGO | S_IWUSR, \
78 }, \ 79 }, \
79 .mask = ML_##_name, \ 80 .mask = ML_##_name, \
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index e8c56a3d9c64..2cadc3009c83 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -256,7 +256,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
256 } \ 256 } \
257} while (0) 257} while (0)
258 258
259#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64) 259#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64) || (defined(CONFIG_UML_X86) && defined(CONFIG_64BIT))
260#define MLFi64 "lld" 260#define MLFi64 "lld"
261#define MLFu64 "llu" 261#define MLFu64 "llu"
262#define MLFx64 "llx" 262#define MLFx64 "llx"
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index cf7828f23361..e1fceb8aa32d 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -756,7 +756,7 @@ static int __init init_o2nm(void)
756 if (!ocfs2_table_header) { 756 if (!ocfs2_table_header) {
757 printk(KERN_ERR "nodemanager: unable to register sysctl\n"); 757 printk(KERN_ERR "nodemanager: unable to register sysctl\n");
758 ret = -ENOMEM; /* or something. */ 758 ret = -ENOMEM; /* or something. */
759 goto out; 759 goto out_o2net;
760 } 760 }
761 761
762 ret = o2net_register_hb_callbacks(); 762 ret = o2net_register_hb_callbacks();
@@ -780,6 +780,8 @@ out_callbacks:
780 o2net_unregister_hb_callbacks(); 780 o2net_unregister_hb_callbacks();
781out_sysctl: 781out_sysctl:
782 unregister_sysctl_table(ocfs2_table_header); 782 unregister_sysctl_table(ocfs2_table_header);
783out_o2net:
784 o2net_exit();
783out: 785out:
784 return ret; 786 return ret;
785} 787}
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index d22d4cf08db1..0f60cc0d3985 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1318,7 +1318,7 @@ static void o2net_start_connect(void *arg)
1318{ 1318{
1319 struct o2net_node *nn = arg; 1319 struct o2net_node *nn = arg;
1320 struct o2net_sock_container *sc = NULL; 1320 struct o2net_sock_container *sc = NULL;
1321 struct o2nm_node *node = NULL; 1321 struct o2nm_node *node = NULL, *mynode = NULL;
1322 struct socket *sock = NULL; 1322 struct socket *sock = NULL;
1323 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, }; 1323 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };
1324 int ret = 0; 1324 int ret = 0;
@@ -1334,6 +1334,12 @@ static void o2net_start_connect(void *arg)
1334 goto out; 1334 goto out;
1335 } 1335 }
1336 1336
1337 mynode = o2nm_get_node_by_num(o2nm_this_node());
1338 if (mynode == NULL) {
1339 ret = 0;
1340 goto out;
1341 }
1342
1337 spin_lock(&nn->nn_lock); 1343 spin_lock(&nn->nn_lock);
1338 /* see if we already have one pending or have given up */ 1344 /* see if we already have one pending or have given up */
1339 if (nn->nn_sc || nn->nn_persistent_error) 1345 if (nn->nn_sc || nn->nn_persistent_error)
@@ -1361,12 +1367,14 @@ static void o2net_start_connect(void *arg)
1361 sock->sk->sk_allocation = GFP_ATOMIC; 1367 sock->sk->sk_allocation = GFP_ATOMIC;
1362 1368
1363 myaddr.sin_family = AF_INET; 1369 myaddr.sin_family = AF_INET;
1370 myaddr.sin_addr.s_addr = (__force u32)mynode->nd_ipv4_address;
1364 myaddr.sin_port = (__force u16)htons(0); /* any port */ 1371 myaddr.sin_port = (__force u16)htons(0); /* any port */
1365 1372
1366 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, 1373 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
1367 sizeof(myaddr)); 1374 sizeof(myaddr));
1368 if (ret) { 1375 if (ret) {
1369 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));
1370 goto out; 1378 goto out;
1371 } 1379 }
1372 1380
@@ -1407,6 +1415,8 @@ out:
1407 sc_put(sc); 1415 sc_put(sc);
1408 if (node) 1416 if (node)
1409 o2nm_node_put(node); 1417 o2nm_node_put(node);
1418 if (mynode)
1419 o2nm_node_put(mynode);
1410 1420
1411 return; 1421 return;
1412} 1422}
diff --git a/fs/ocfs2/cluster/tcp.h b/fs/ocfs2/cluster/tcp.h
index a6f4585501c8..616ff2b8434a 100644
--- a/fs/ocfs2/cluster/tcp.h
+++ b/fs/ocfs2/cluster/tcp.h
@@ -85,13 +85,10 @@ enum {
85 O2NET_DRIVER_READY, 85 O2NET_DRIVER_READY,
86}; 86};
87 87
88int o2net_init_tcp_sock(struct inode *inode);
89int o2net_send_message(u32 msg_type, u32 key, void *data, u32 len, 88int o2net_send_message(u32 msg_type, u32 key, void *data, u32 len,
90 u8 target_node, int *status); 89 u8 target_node, int *status);
91int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *vec, 90int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *vec,
92 size_t veclen, u8 target_node, int *status); 91 size_t veclen, u8 target_node, int *status);
93int o2net_broadcast_message(u32 msg_type, u32 key, void *data, u32 len,
94 struct inode *group);
95 92
96int o2net_register_handler(u32 msg_type, u32 key, u32 max_len, 93int o2net_register_handler(u32 msg_type, u32 key, u32 max_len,
97 o2net_msg_handler_func *func, void *data, 94 o2net_msg_handler_func *func, void *data,
@@ -107,7 +104,5 @@ void o2net_disconnect_node(struct o2nm_node *node);
107 104
108int o2net_init(void); 105int o2net_init(void);
109void o2net_exit(void); 106void o2net_exit(void);
110int o2net_proc_init(struct proc_dir_entry *parent);
111void o2net_proc_exit(struct proc_dir_entry *parent);
112 107
113#endif /* O2CLUSTER_TCP_H */ 108#endif /* O2CLUSTER_TCP_H */