From: Alexander Aring Date: Wed, 2 Jun 2021 09:45:18 -0400 Subject: [Cluster-devel] [PATCH dlm/next 4/6] fs: dlm: move dlm allow conn In-Reply-To: <20210602134520.71030-1-aahringo@redhat.com> References: <20210602134520.71030-1-aahringo@redhat.com> Message-ID: <20210602134520.71030-4-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch checks if possible allowing new connections is allowed before queueing the listen socket to accept new connections. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 02b636d113fb..6b150e3aa30c 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -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; -- 2.26.3