Skip to content

Commit

Permalink
dlm: fix lowcomms_connect_node for sctp
Browse files Browse the repository at this point in the history
The recently added dlm_lowcomms_connect_node() from
391fbdc does not work
when using SCTP instead of TCP.  The sctp connection code
has nothing to do without data to send.  Check for no data
in the sctp connection code and do nothing instead of
triggering a BUG.  Also have connect_node() do nothing
when the protocol is sctp.

Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
David Teigland committed Sep 30, 2009
1 parent 9c1fe83 commit 04bedd7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ int dlm_lowcomms_connect_node(int nodeid)
{
struct connection *con;

/* with sctp there's no connecting without sending */
if (dlm_config.ci_protocol != 0)
return 0;

if (nodeid == dlm_our_nodeid())
return 0;

Expand Down Expand Up @@ -855,11 +859,14 @@ static void sctp_init_assoc(struct connection *con)
outmessage.msg_flags = MSG_EOR;

spin_lock(&con->writequeue_lock);
e = list_entry(con->writequeue.next, struct writequeue_entry,
list);

BUG_ON((struct list_head *) e == &con->writequeue);
if (list_empty(&con->writequeue)) {
spin_unlock(&con->writequeue_lock);
log_print("writequeue empty for nodeid %d", con->nodeid);
return;
}

e = list_first_entry(&con->writequeue, struct writequeue_entry, list);
len = e->len;
offset = e->offset;
spin_unlock(&con->writequeue_lock);
Expand Down

0 comments on commit 04bedd7

Please sign in to comment.