]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xprtrdma: Fix cwnd update ordering
authorChuck Lever <chuck.lever@oracle.com>
Mon, 19 Apr 2021 18:02:41 +0000 (14:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:42 +0000 (10:29 +0200)
commit8834ecb5df22b7ff3c9b0deba7726579bb613f95
tree6692faa0da7c93e8d794ab352af9bb8a59197bee
parent6276265c31a70fa88a8c1317e09f2e01d4d9c339
xprtrdma: Fix cwnd update ordering

[ Upstream commit 35d8b10a25884050bb3b0149b62c3818ec59f77c ]

After a reconnect, the reply handler is opening the cwnd (and thus
enabling more RPC Calls to be sent) /before/ rpcrdma_post_recvs()
can post enough Receive WRs to receive their replies. This causes an
RNR and the new connection is lost immediately.

The race is most clearly exposed when KASAN and disconnect injection
are enabled. This slows down rpcrdma_rep_create() enough to allow
the send side to post a bunch of RPC Calls before the Receive
completion handler can invoke ib_post_recv().

Fixes: 2ae50ad68cd7 ("xprtrdma: Close window between waking RPC senders and posting Receives")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/xprtrdma/rpc_rdma.c
net/sunrpc/xprtrdma/verbs.c
net/sunrpc/xprtrdma/xprt_rdma.h