Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marcelo Ricardo Leitner and committed by
David Teigland
00dcffae acee4e52

+3 -3
+3 -3
fs/dlm/lowcomms.c
··· 1020 1020 1021 1021 out: 1022 1022 mutex_unlock(&con->sock_mutex); 1023 + set_bit(CF_WRITE_PENDING, &con->flags); 1023 1024 } 1024 1025 1025 1026 /* Connect a new socket to its peer */ ··· 1115 1114 } 1116 1115 out: 1117 1116 mutex_unlock(&con->sock_mutex); 1117 + set_bit(CF_WRITE_PENDING, &con->flags); 1118 1118 return; 1119 1119 } 1120 1120 ··· 1504 1502 { 1505 1503 struct connection *con = container_of(work, struct connection, swork); 1506 1504 1507 - if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) { 1505 + if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) 1508 1506 con->connect_action(con); 1509 - set_bit(CF_WRITE_PENDING, &con->flags); 1510 - } 1511 1507 if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags)) 1512 1508 send_to_sock(con); 1513 1509 }