Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa18464 authored by tsutomu.owa@toshiba.co.jp's avatar tsutomu.owa@toshiba.co.jp Committed by David Teigland
Browse files

DLM: fix to reschedule rwork



When an error occurs in kernel_recvmsg or kernel_sendpage and
close_connection is called and receive work is already scheduled,
receive work is canceled. In that case, the receive work will not
be scheduled forever after reconnection, because CF_READ_PENDING
flag is established.

Signed-off-by: default avatarTadashi Miyauchi <miyauchi@toshiba-tops.co.jp>
Signed-off-by: default avatarTsutomu Owa <tsutomu.owa@toshiba.co.jp>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 93eaadeb
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -593,10 +593,14 @@ static void close_connection(struct connection *con, bool and_other,
{
	bool closing = test_and_set_bit(CF_CLOSING, &con->flags);

	if (tx && !closing && cancel_work_sync(&con->swork))
	if (tx && !closing && cancel_work_sync(&con->swork)) {
		log_print("canceled swork for node %d", con->nodeid);
	if (rx && !closing && cancel_work_sync(&con->rwork))
		clear_bit(CF_WRITE_PENDING, &con->flags);
	}
	if (rx && !closing && cancel_work_sync(&con->rwork)) {
		log_print("canceled rwork for node %d", con->nodeid);
		clear_bit(CF_READ_PENDING, &con->flags);
	}

	mutex_lock(&con->sock_mutex);
	if (con->sock) {