Skip to content

Commit 9a4139a

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: move dlm allow conn
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]>
1 parent 6c6a1cc commit 9a4139a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/dlm/lowcomms.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ static void lowcomms_data_ready(struct sock *sk)
471471

472472
static void lowcomms_listen_data_ready(struct sock *sk)
473473
{
474+
if (!dlm_allow_conn)
475+
return;
476+
474477
queue_work(recv_workqueue, &listen_con.rwork);
475478
}
476479

@@ -969,10 +972,6 @@ static int accept_from_sock(struct listen_connection *con)
969972
struct connection *addcon;
970973
unsigned int mark;
971974

972-
if (!dlm_allow_conn) {
973-
return -1;
974-
}
975-
976975
if (!con->sock)
977976
return -ENOTCONN;
978977

0 commit comments

Comments
 (0)