Skip to content

Commit

Permalink
dlm: fix reconnecting but not sending data
Browse files Browse the repository at this point in the history
There are cases on which lowcomms_connect_sock() is called directly,
which caused the CF_WRITE_PENDING flag to not bet set upon reconnect,
specially on send_to_sock() error handling. On this last, the flag was
already cleared and no further attempt on transmitting would be done.

As dlm tends to connect when it needs to transmit something, it makes
sense to always mark this flag right after the connect.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Marcelo Ricardo Leitner authored and David Teigland committed Aug 17, 2015
1 parent acee4e5 commit 00dcffa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ static void sctp_connect_to_sock(struct connection *con)

out:
mutex_unlock(&con->sock_mutex);
set_bit(CF_WRITE_PENDING, &con->flags);
}

/* Connect a new socket to its peer */
Expand Down Expand Up @@ -1114,6 +1115,7 @@ static void tcp_connect_to_sock(struct connection *con)
}
out:
mutex_unlock(&con->sock_mutex);
set_bit(CF_WRITE_PENDING, &con->flags);
return;
}

Expand Down Expand Up @@ -1502,10 +1504,8 @@ static void process_send_sockets(struct work_struct *work)
{
struct connection *con = container_of(work, struct connection, swork);

if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) {
if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags))
con->connect_action(con);
set_bit(CF_WRITE_PENDING, &con->flags);
}
if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags))
send_to_sock(con);
}
Expand Down

0 comments on commit 00dcffa

Please sign in to comment.