SUNRPC: Fix a race with XPRT_CONNECTING
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 17 Dec 2018 22:38:51 +0000 (17:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:01:00 +0000 (10:01 +0100)
commit8265e34e5705c21978f1e3359c430832110057f1
treea655f9b7fc810103d73acbc7ee5c83a6a0764c61
parent1eac41bac7c9a578c6bd93d4660fa4c67b4238d9
SUNRPC: Fix a race with XPRT_CONNECTING

[ Upstream commit cf76785d30712d90185455e752337acdb53d2a5d ]

Ensure that we clear XPRT_CONNECTING before releasing the XPRT_LOCK so that
we don't have races between the (asynchronous) socket setup code and
tasks in xprt_connect().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/xprtsock.c