diff options
author | Alexander Aring | 2022-10-27 16:45:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-01-07 11:11:44 +0100 |
commit | 5a52012ff8b0c14354085bd86759ed81c1873acf (patch) | |
tree | dbd03dc34dfc61e58e2d3fc780fa4e0e95af7b4b | |
parent | 9e72fec62f315117e195b38c5c89b1cd53e9f703 (diff) |
fs: dlm: retry accept() until -EAGAIN or error returns
commit f0f4bb431bd543ed7bebbaea3ce326cfcd5388bc upstream.
This patch fixes a race if we get two times an socket data ready event
while the listen connection worker is queued. Currently it will be
served only once but we need to do it (in this case twice) until we hit
-EAGAIN which tells us there is no pending accept going on.
This patch wraps an do while loop until we receive a return value which
is different than 0 as it was done before commit d11ccd451b65 ("fs: dlm:
listen socket out of connection hash").
Cc: stable@vger.kernel.org
Fixes: d11ccd451b65 ("fs: dlm: listen socket out of connection hash")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/dlm/lowcomms.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 2cb9f3b49e05..871d4e9f49fb 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1543,7 +1543,11 @@ static void process_recv_sockets(struct work_struct *work) static void process_listen_recv_socket(struct work_struct *work) { - accept_from_sock(&listen_con); + int ret; + + do { + ret = accept_from_sock(&listen_con); + } while (!ret); } static void dlm_connect(struct connection *con) |