From: Trond Myklebust Date: Tue, 12 Dec 2023 14:34:08 +0000 (+0100) Subject: SUNRPC: Don't try to send when the connection is shutting down X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0c14584cdbdb58ecc14d149a81ca6c3d42cd38ec;p=linux.git SUNRPC: Don't try to send when the connection is shutting down If the connection has been scheduled to shut down, we must assume that the socket is not in a state to accept further transmissions until the connection has been re-established. Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index af13fdfa66721..db3754a3298f9 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1541,6 +1541,9 @@ xprt_request_transmit(struct rpc_rqst *req, struct rpc_task *snd_task) int is_retrans = RPC_WAS_SENT(task); int status; + if (test_bit(XPRT_CLOSE_WAIT, &xprt->state)) + return -ENOTCONN; + if (!req->rq_bytes_sent) { if (xprt_request_data_received(task)) { status = 0;