[RFC PATCH v1 2/8] sunrpc: fail only the RPC a transport refuses
From: Pranjal Shrivastava
Date: Tue Oct 06 2026 - 19:35:44 EST
A transport returns -EREMOTEIO from ->send_request() for a request
whose P2PDMA pages it cannot move. Retrying doesn't help, but today
the error stops xprt_transmit(), finds whichever task is draining
the transmit queue, and leaves the refused request queued.
Dequeue the request, on -EREMOTEIO, cancel only its own task with
rpc_task_try_cancel(), and keep draining. Setting tk_status instead
would not work, a dequeued task looks transmitted and would wait for
a reply that never comes.
Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
---
net/sunrpc/xprt.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 48a3618cbb29..084d5a508357 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1579,6 +1579,15 @@ xprt_request_transmit(struct rpc_rqst *req, struct rpc_task *snd_task)
if (status != 0) {
req->rq_ntrans--;
trace_xprt_transmit(req, status);
+ if (status == -EREMOTEIO) {
+ /*
+ * This transport will never send req. Fail only
+ * its task, and let the caller keep draining.
+ */
+ xprt_request_dequeue_transmit(task);
+ rpc_task_try_cancel(task, status);
+ return 0;
+ }
return status;
}
--
2.56.0.rc1.315.gc6ed9934b7-goog