aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2015-08-11 18:22:25 -0400
committerDavid Teigland <teigland@redhat.com>2015-08-17 17:22:21 -0400
commit00dcffaebf7b4ab0524c56694c22de6b0eb22feb (patch)
treeaa30d58d5a2a9616c09f6ec289c9c967568e67a3 /fs/dlm
parentacee4e527d5f069351f835602b23602d01de5e1f (diff)
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>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lowcomms.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 4ea64e93e6b1..cd008c94efb8 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1020,6 +1020,7 @@ socket_err:
1020 1020
1021out: 1021out:
1022 mutex_unlock(&con->sock_mutex); 1022 mutex_unlock(&con->sock_mutex);
1023 set_bit(CF_WRITE_PENDING, &con->flags);
1023} 1024}
1024 1025
1025/* Connect a new socket to its peer */ 1026/* Connect a new socket to its peer */
@@ -1114,6 +1115,7 @@ out_err:
1114 } 1115 }
1115out: 1116out:
1116 mutex_unlock(&con->sock_mutex); 1117 mutex_unlock(&con->sock_mutex);
1118 set_bit(CF_WRITE_PENDING, &con->flags);
1117 return; 1119 return;
1118} 1120}
1119 1121
@@ -1502,10 +1504,8 @@ static void process_send_sockets(struct work_struct *work)
1502{ 1504{
1503 struct connection *con = container_of(work, struct connection, swork); 1505 struct connection *con = container_of(work, struct connection, swork);
1504 1506
1505 if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) { 1507 if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags))
1506 con->connect_action(con); 1508 con->connect_action(con);
1507 set_bit(CF_WRITE_PENDING, &con->flags);
1508 }
1509 if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags)) 1509 if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags))
1510 send_to_sock(con); 1510 send_to_sock(con);
1511} 1511}