aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2015-08-11 18:22:24 -0400
committerDavid Teigland <teigland@redhat.com>2015-08-17 17:22:21 -0400
commitacee4e527d5f069351f835602b23602d01de5e1f (patch)
tree5b3656ad50cb95fd579355579fcf74f1f99e69c9
parentee44b4bc054afc586c92558a225055ef9fd25d17 (diff)
dlm: replace BUG_ON with a less severe handling
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> Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r--fs/dlm/lowcomms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 856d750be96b..4ea64e93e6b1 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -542,6 +542,10 @@ static int receive_from_sock(struct connection *con)
542 ret = -EAGAIN; 542 ret = -EAGAIN;
543 goto out_close; 543 goto out_close;
544 } 544 }
545 if (con->nodeid == 0) {
546 ret = -EINVAL;
547 goto out_close;
548 }
545 549
546 if (con->rx_page == NULL) { 550 if (con->rx_page == NULL) {
547 /* 551 /*
@@ -582,8 +586,6 @@ static int receive_from_sock(struct connection *con)
582 else if (ret == len) 586 else if (ret == len)
583 call_again_soon = 1; 587 call_again_soon = 1;
584 588
585 BUG_ON(con->nodeid == 0);
586
587 cbuf_add(&con->cb, ret); 589 cbuf_add(&con->cb, ret);
588 ret = dlm_process_incoming_buffer(con->nodeid, 590 ret = dlm_process_incoming_buffer(con->nodeid,
589 page_address(con->rx_page), 591 page_address(con->rx_page),