Skip to content

Commit

Permalink
fs: dlm: move dlm allow conn
Browse files Browse the repository at this point in the history
This patch checks if possible allowing new connections is allowed before
queueing the listen socket to accept new connections.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Jun 2, 2021
1 parent 6c6a1cc commit 9a4139a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 9a4139a

Please sign in to comment.