Skip to content

Commit 7b2182e

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Fix handling of RDMA_ERROR replies
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 <[email protected]> Cc: <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent c487eb7 commit 7b2182e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

net/sunrpc/xprtrdma/rpc_rdma.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,7 @@ rpcrdma_decode_error(struct rpcrdma_xprt *r_xprt, struct rpcrdma_rep *rep,
13491349
be32_to_cpup(p), be32_to_cpu(rep->rr_xid));
13501350
}
13511351

1352-
r_xprt->rx_stats.bad_reply_count++;
1353-
return -EREMOTEIO;
1352+
return -EIO;
13541353
}
13551354

13561355
/* Perform XID lookup, reconstruction of the RPC reply, and
@@ -1387,13 +1386,11 @@ void rpcrdma_complete_rqst(struct rpcrdma_rep *rep)
13871386
spin_unlock(&xprt->queue_lock);
13881387
return;
13891388

1390-
/* If the incoming reply terminated a pending RPC, the next
1391-
* RPC call will post a replacement receive buffer as it is
1392-
* being marshaled.
1393-
*/
13941389
out_badheader:
13951390
trace_xprtrdma_reply_hdr(rep);
13961391
r_xprt->rx_stats.bad_reply_count++;
1392+
rqst->rq_task->tk_status = status;
1393+
status = 0;
13971394
goto out;
13981395
}
13991396

0 commit comments

Comments
 (0)