]> git.baikalelectronics.ru Git - kernel.git/commit
fs: dlm: retry accept() until -EAGAIN or error returns
authorAlexander Aring <aahringo@redhat.com>
Thu, 27 Oct 2022 20:45:12 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:44 +0000 (11:11 +0100)
commit2dbe07b48923762e6c59596c35a2fd67fc6b0e06
treedbd03dc34dfc61e58e2d3fc780fa4e0e95af7b4b
parent2ef4cd2d0b7752743e5ba7da1e139277171148ee
fs: dlm: retry accept() until -EAGAIN or error returns

commit 52f5bbbd82d1432eb239bf28da957b0db0539a2f 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 82150cbbce25 ("fs: dlm:
listen socket out of connection hash").

Cc: stable@vger.kernel.org
Fixes: 82150cbbce25 ("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>
fs/dlm/lowcomms.c