xprtrdma: Fix handling of RDMA_ERROR replies
authorChuck Lever <chuck.lever@oracle.com>
Mon, 15 Jun 2020 13:21:13 +0000 (09:21 -0400)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:36:31 +0000 (15:36 -0400)
commit301cca2f313a0b6167e9b033bdd25a258c202693
tree5035c20e199ce3770cfca826b7dbd0bf7debfd2f
parent9e2f2568552cee6344d886d29700691fbc72b842
xprtrdma: Fix handling of RDMA_ERROR replies

commit 7b2182ec381f8ea15c7eb1266d6b5d7da620ad93 upstream.

The RPC client currently doesn't handle ERR_CHUNK replies correctly.
rpcrdma_complete_rqst() incorrectly passes a negative number to
xprt_complete_rqst() as the number of bytes copied. Instead, set
task->tk_status to the error value, and return zero bytes copied.

In these cases, return -EIO rather than -EREMOTEIO. The RPC client's
finite state machine doesn't know what to do with -EREMOTEIO.

Additional clean ups:
- Don't double-count RDMA_ERROR replies
- Remove a stale comment

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: <stable@kernel.vger.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sunrpc/xprtrdma/rpc_rdma.c