SUNRPC: Fix a race in the receive code path
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 15 Dec 2017 02:24:08 +0000 (21:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:10:21 +0000 (10:10 +0100)
commit7dd1362247ebfe06ab1f58d7fee739c5f773a0ac
tree895225f5b1664dbb5d03142f2e9494c8c3869b85
parentfbce429b410cc443ec3fa3293a0e4e5804ae4f2d
SUNRPC: Fix a race in the receive code path

commit 90d91b0cd371193d9dbfa9beacab8ab9a4cb75e0 upstream.

We must ensure that the call to rpc_sleep_on() in xprt_transmit() cannot
race with the call to xprt_complete_rqst().

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=317
Fixes: ce7c252a8c74 ("SUNRPC: Add a separate spinlock to protect..")
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprt.c