aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2023-12-12 16:13:22 +0100
committerTrond Myklebust <trond.myklebust@hammerspace.com>2024-02-28 15:00:14 -0500
commit3f7edeac0bbb301a07d7ea2abd28727aaa7fdab0 (patch)
tree7febf2a73ff28a5e3a9c0189e0063e9e2e26d4f7 /net/sunrpc/xprt.c
parent0c14584cdbdb58ecc14d149a81ca6c3d42cd38ec (diff)
downloadlinux-3f7edeac0bbb301a07d7ea2abd28727aaa7fdab0.tar.gz
SUNRPC: Add a transport callback to handle dequeuing of an RPC request
Add a transport level callback to allow it to handle the consequences of dequeuing the request that was in the process of being transmitted. For something like a TCP connection, we may need to disconnect if the request was partially transmitted. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index db3754a3298f9d..09f245cda5262a 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1398,6 +1398,12 @@ xprt_request_dequeue_transmit_locked(struct rpc_task *task)
if (!test_and_clear_bit(RPC_TASK_NEED_XMIT, &task->tk_runstate))
return;
if (!list_empty(&req->rq_xmit)) {
+ struct rpc_xprt *xprt = req->rq_xprt;
+
+ if (list_is_first(&req->rq_xmit, &xprt->xmit_queue) &&
+ xprt->ops->abort_send_request)
+ xprt->ops->abort_send_request(req);
+
list_del(&req->rq_xmit);
if (!list_empty(&req->rq_xmit2)) {
struct rpc_rqst *next = list_first_entry(&req->rq_xmit2,