Skip to content

Commit 00dcffa

Browse files
marceloleitnerteigland
authored andcommitted
dlm: fix reconnecting but not sending data
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>
1 parent acee4e5 commit 00dcffa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/dlm/lowcomms.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ static void sctp_connect_to_sock(struct connection *con)
10201020

10211021
out:
10221022
mutex_unlock(&con->sock_mutex);
1023+
set_bit(CF_WRITE_PENDING, &con->flags);
10231024
}
10241025

10251026
/* Connect a new socket to its peer */
@@ -1114,6 +1115,7 @@ static void tcp_connect_to_sock(struct connection *con)
11141115
}
11151116
out:
11161117
mutex_unlock(&con->sock_mutex);
1118+
set_bit(CF_WRITE_PENDING, &con->flags);
11171119
return;
11181120
}
11191121

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

1505-
if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) {
1507+
if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags))
15061508
con->connect_action(con);
1507-
set_bit(CF_WRITE_PENDING, &con->flags);
1508-
}
15091509
if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags))
15101510
send_to_sock(con);
15111511
}

0 commit comments

Comments
 (0)