Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de1d70da authored by Chuck Lever's avatar Chuck Lever Committed by Sasha Levin
Browse files

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: default avatarChuck Lever <chuck.lever@oracle.com>
Cc: <stable@kernel.vger.org>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d35ca87
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -1246,8 +1246,7 @@ rpcrdma_decode_error(struct rpcrdma_xprt *r_xprt, struct rpcrdma_rep *rep,
			be32_to_cpup(p), be32_to_cpu(rep->rr_xid));
			be32_to_cpup(p), be32_to_cpu(rep->rr_xid));
	}
	}


	r_xprt->rx_stats.bad_reply_count++;
	return -EIO;
	return -EREMOTEIO;
}
}


/* Perform XID lookup, reconstruction of the RPC reply, and
/* Perform XID lookup, reconstruction of the RPC reply, and
@@ -1284,13 +1283,11 @@ void rpcrdma_complete_rqst(struct rpcrdma_rep *rep)
	spin_unlock(&xprt->queue_lock);
	spin_unlock(&xprt->queue_lock);
	return;
	return;


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