From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: cluster-devel@redhat.com
Cc: netdev@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>,
David Teigland <teigland@redhat.com>,
tan.hu@zte.com.cn
Subject: [PATCH 6/6] dlm: fix reconnecting but not sending data
Date: Tue, 11 Aug 2015 19:22:25 -0300 [thread overview]
Message-ID: <6db0ee7aaed04d6d38f575a7e7f04817b0aab76b.1439330654.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <cover.1439330654.git.marcelo.leitner@gmail.com>
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>
---
fs/dlm/lowcomms.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 4ea64e93e6b19ea24132606cffaca8bb502d18ab..cd008c94efb8bbec0cc1f0123c9bebf7a58b48b5 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1020,6 +1020,7 @@ socket_err:
out:
mutex_unlock(&con->sock_mutex);
+ set_bit(CF_WRITE_PENDING, &con->flags);
}
/* Connect a new socket to its peer */
@@ -1114,6 +1115,7 @@ out_err:
}
out:
mutex_unlock(&con->sock_mutex);
+ set_bit(CF_WRITE_PENDING, &con->flags);
return;
}
@@ -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);
}
--
2.4.3
prev parent reply other threads:[~2015-08-11 22:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1439330654.git.marcelo.leitner@gmail.com>
2015-08-11 22:22 ` [PATCH 1/6] dlm: fix connection stealing if using SCTP Marcelo Ricardo Leitner
2015-08-11 22:22 ` [PATCH 2/6] dlm: fix race while closing connections Marcelo Ricardo Leitner
2015-08-11 22:22 ` [PATCH 3/6] dlm: fix not reconnecting on connecting error handling Marcelo Ricardo Leitner
2015-08-11 22:22 ` [PATCH 4/6] dlm: use sctp 1-to-1 API Marcelo Ricardo Leitner
2015-08-12 10:23 ` David Laight
2015-08-12 13:16 ` Marcelo Ricardo Leitner
2015-08-12 15:33 ` David Laight
2015-08-12 16:42 ` Marcelo Ricardo Leitner
2015-08-13 9:37 ` [Cluster-devel] " Steven Whitehouse
2015-08-13 12:13 ` Marcelo Ricardo Leitner
2015-08-11 22:22 ` [PATCH 5/6] dlm: replace BUG_ON with a less severe handling Marcelo Ricardo Leitner
2015-08-11 22:22 ` Marcelo Ricardo Leitner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6db0ee7aaed04d6d38f575a7e7f04817b0aab76b.1439330654.git.marcelo.leitner@gmail.com \
--to=marcelo.leitner@gmail.com \
--cc=cluster-devel@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=tan.hu@zte.com.cn \
--cc=teigland@redhat.com \
--cc=vyasevich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).