[Devel] [PATCH RHEL7 COMMIT] ms/SUNRPC: The TCP back channel mustn't disappear while requests are outstanding

Konstantin Khorenko khorenko at virtuozzo.com
Mon Dec 9 14:13:38 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-1062.7.1.vz7.130.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.7.1.vz7.130.1
------>
commit 6263eea4d4ed66429cdd7d7f28c99e0bd8e0f87c
Author: Trond Myklebust <trondmy at gmail.com>
Date:   Mon Dec 9 14:13:36 2019 +0300

    ms/SUNRPC: The TCP back channel mustn't disappear while requests are outstanding
    
    Backport of ML commit 875f0706accd6501c3209bb99df8573171fb5d75
    
         SUNRPC: The TCP back channel mustn't disappear while requests are outstanding
    
         If there are TCP back channel requests being processed by the
         server threads, then we should hold a reference to the transport
         to ensure it doesn't get freed from underneath us.
    
         Reported-by: Neil Brown <neilb at suse.de>
    
    https://jira.sw.ru/browse/PSBM-99764
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    Reviewed-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 net/sunrpc/backchannel_rqst.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 103cc7d97638..e77fd211198c 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -305,8 +305,8 @@ void xprt_free_bc_rqst(struct rpc_rqst *req)
 		 */
 		dprintk("RPC:       Last session removed req=%p\n", req);
 		xprt_free_allocation(req);
-		return;
 	}
+	xprt_put(xprt);
 }
 
 /*
@@ -357,6 +357,7 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied)
 	set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
 
 	dprintk("RPC:       add callback request to list\n");
+	xprt_get(xprt);
 	spin_lock(&bc_serv->sv_cb_lock);
 	list_add(&req->rq_bc_list, &bc_serv->sv_cb_list);
 	wake_up(&bc_serv->sv_cb_waitq);



More information about the Devel mailing list