diff options
-rw-r--r-- | fs/dlm/lowcomms.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 240cef14fe58..a3350e4c8184 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -316,6 +316,10 @@ int dlm_lowcomms_connect_node(int nodeid) | |||
316 | { | 316 | { |
317 | struct connection *con; | 317 | struct connection *con; |
318 | 318 | ||
319 | /* with sctp there's no connecting without sending */ | ||
320 | if (dlm_config.ci_protocol != 0) | ||
321 | return 0; | ||
322 | |||
319 | if (nodeid == dlm_our_nodeid()) | 323 | if (nodeid == dlm_our_nodeid()) |
320 | return 0; | 324 | return 0; |
321 | 325 | ||
@@ -855,11 +859,14 @@ static void sctp_init_assoc(struct connection *con) | |||
855 | outmessage.msg_flags = MSG_EOR; | 859 | outmessage.msg_flags = MSG_EOR; |
856 | 860 | ||
857 | spin_lock(&con->writequeue_lock); | 861 | spin_lock(&con->writequeue_lock); |
858 | e = list_entry(con->writequeue.next, struct writequeue_entry, | ||
859 | list); | ||
860 | 862 | ||
861 | BUG_ON((struct list_head *) e == &con->writequeue); | 863 | if (list_empty(&con->writequeue)) { |
864 | spin_unlock(&con->writequeue_lock); | ||
865 | log_print("writequeue empty for nodeid %d", con->nodeid); | ||
866 | return; | ||
867 | } | ||
862 | 868 | ||
869 | e = list_first_entry(&con->writequeue, struct writequeue_entry, list); | ||
863 | len = e->len; | 870 | len = e->len; |
864 | offset = e->offset; | 871 | offset = e->offset; |
865 | spin_unlock(&con->writequeue_lock); | 872 | spin_unlock(&con->writequeue_lock); |