From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 5/6] dlm: replace BUG_ON with a less severe handling
Date: Tue, 11 Aug 2015 19:22:24 -0300 [thread overview]
Message-ID: <37a757426f801e8df46a903f2603bb257721f996.1439330654.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <cover.1439330654.git.marcelo.leitner@gmail.com>
BUG_ON() is a severe action for this case, specially now that DLM with
SCTP will use 1 socket per association. Instead, we can just close the
socket on this error condition and return from the function.
Also move the check to an earlier stage as it won't change and thus we
can abort as soon as possible.
Although this issue was reported when still using SCTP with 1-to-many
API, this cleanup wouldn't be that simple back then because we couldn't
close the socket and making sure such event would cease would be hard.
And actually, previous code was closing the association, yet SCTP layer
is still raising the new data event. Probably a bug to be fixed in SCTP.
Reported-by: <tan.hu@zte.com.cn>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
fs/dlm/lowcomms.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 856d750be96b64d06c48a1a4e2a68785e8dda048..4ea64e93e6b19ea24132606cffaca8bb502d18ab 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -542,6 +542,10 @@ static int receive_from_sock(struct connection *con)
ret = -EAGAIN;
goto out_close;
}
+ if (con->nodeid == 0) {
+ ret = -EINVAL;
+ goto out_close;
+ }
if (con->rx_page == NULL) {
/*
@@ -582,8 +586,6 @@ static int receive_from_sock(struct connection *con)
else if (ret == len)
call_again_soon = 1;
- BUG_ON(con->nodeid == 0);
-
cbuf_add(&con->cb, ret);
ret = dlm_process_incoming_buffer(con->nodeid,
page_address(con->rx_page),
--
2.4.3
next 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 ` [Cluster-devel] [PATCH 1/6] dlm: fix connection stealing if using SCTP Marcelo Ricardo Leitner
2015-08-11 22:22 ` [Cluster-devel] [PATCH 2/6] dlm: fix race while closing connections Marcelo Ricardo Leitner
2015-08-11 22:22 ` [Cluster-devel] [PATCH 3/6] dlm: fix not reconnecting on connecting error handling Marcelo Ricardo Leitner
2015-08-11 22:22 ` [Cluster-devel] [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 ` Steven Whitehouse
2015-08-13 12:13 ` Marcelo Ricardo Leitner
2015-08-11 22:22 ` Marcelo Ricardo Leitner [this message]
2015-08-11 22:22 ` [Cluster-devel] [PATCH 6/6] dlm: fix reconnecting but not sending data Marcelo Ricardo Leitner
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=37a757426f801e8df46a903f2603bb257721f996.1439330654.git.marcelo.leitner@gmail.com \
--to=marcelo.leitner@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).