]> Git Repo - J-linux.git/commitdiff
fs: dlm: don't close socket on invalid message
authorAlexander Aring <[email protected]>
Mon, 27 Jul 2020 13:13:36 +0000 (09:13 -0400)
committerDavid Teigland <[email protected]>
Thu, 6 Aug 2020 15:30:53 +0000 (10:30 -0500)
This patch doesn't close sockets when there is an invalid dlm message
received. The connection will probably reconnect anyway so. To not
close the connection will reduce the number of possible failtures.
As we don't have a different strategy to react on such scenario
just keep going the connection and ignore the message.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
fs/dlm/lowcomms.c

index 3fa1b93dbbc7e4e468ef1f18c24138f6a0417969..9e6acbb47bb9a9a31d2766df020d40ce6f004315 100644 (file)
@@ -685,14 +685,14 @@ static int receive_from_sock(struct connection *con)
                                          page_address(con->rx_page),
                                          con->cb.base, con->cb.len,
                                          PAGE_SIZE);
-       if (ret == -EBADMSG) {
-               log_print("lowcomms: addr=%p, base=%u, len=%u, read=%d",
-                         page_address(con->rx_page), con->cb.base,
+       if (ret < 0) {
+               log_print("lowcomms err %d: addr=%p, base=%u, len=%u, read=%d",
+                         ret, page_address(con->rx_page), con->cb.base,
                          con->cb.len, r);
+               cbuf_eat(&con->cb, r);
+       } else {
+               cbuf_eat(&con->cb, ret);
        }
-       if (ret < 0)
-               goto out_close;
-       cbuf_eat(&con->cb, ret);
 
        if (cbuf_empty(&con->cb) && !call_again_soon) {
                __free_page(con->rx_page);
This page took 0.062871 seconds and 4 git commands to generate.