]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
SUNRPC: Ignore queue transmission errors on successful transmission
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 15 Apr 2019 15:54:13 +0000 (11:54 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 17 Apr 2019 20:07:28 +0000 (16:07 -0400)
If a request transmission fails due to write space or slot unavailability
errors, but the queued task then gets transmitted before it has time to
process the error in call_transmit_status() or call_bc_transmit_status(),
we need to suppress the transmission error code to prevent it from leaking
out of the RPC layer.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/clnt.c

index 1d0395ef62c95b9285bdaca47f96f48a3d5093bf..8ff11dc98d7f93fefeff6ecc53ff6d7815da47f8 100644 (file)
@@ -2081,8 +2081,8 @@ call_transmit_status(struct rpc_task *task)
         * test first.
         */
        if (rpc_task_transmitted(task)) {
-               if (task->tk_status == 0)
-                       xprt_request_wait_receive(task);
+               task->tk_status = 0;
+               xprt_request_wait_receive(task);
                return;
        }
 
@@ -2167,6 +2167,9 @@ call_bc_transmit_status(struct rpc_task *task)
 {
        struct rpc_rqst *req = task->tk_rqstp;
 
+       if (rpc_task_transmitted(task))
+               task->tk_status = 0;
+
        dprint_status(task);
 
        switch (task->tk_status) {