fs: dlm: move dlm allow conn
authorAlexander Aring <aahringo@redhat.com>
Wed, 2 Jun 2021 13:45:18 +0000 (09:45 -0400)
committerDavid Teigland <teigland@redhat.com>
Wed, 2 Jun 2021 16:53:04 +0000 (11:53 -0500)
This patch checks if possible allowing new connections is allowed before
queueing the listen socket to accept new connections.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c

index 02b636d113fb7463fb30ee1124808eb936dc8b4b..6b150e3aa30c7a991d83b5aa0ca405af7ad5db33 100644 (file)
@@ -471,6 +471,9 @@ static void lowcomms_data_ready(struct sock *sk)
 
 static void lowcomms_listen_data_ready(struct sock *sk)
 {
+       if (!dlm_allow_conn)
+               return;
+
        queue_work(recv_workqueue, &listen_con.rwork);
 }
 
@@ -969,10 +972,6 @@ static int accept_from_sock(struct listen_connection *con)
        struct connection *addcon;
        unsigned int mark;
 
-       if (!dlm_allow_conn) {
-               return -1;
-       }
-
        if (!con->sock)
                return -ENOTCONN;