[Devel] [PATCH RH76 1/3] revert old fix for PSBM-89609
Vasily Averin
vvs at virtuozzo.com
Tue Jan 15 12:04:41 MSK 2019
revert commit 3bb14d8f42e ("nfs: serv->sv_bc_xprt misuse in bc_svc_process()")
will use backport of mainline patches instead
https://jira.sw.ru/browse/PSBM-89609
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
include/linux/sunrpc/xprt.h | 1 -
net/sunrpc/svc.c | 22 ++++++----------------
net/sunrpc/xprtrdma/backchannel.c | 5 -----
net/sunrpc/xprtrdma/transport.c | 1 -
net/sunrpc/xprtrdma/xprt_rdma.h | 1 -
net/sunrpc/xprtsock.c | 7 -------
6 files changed, 6 insertions(+), 31 deletions(-)
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e42729d093b0..f8dac4d99e5e 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -144,7 +144,6 @@ struct rpc_xprt_ops {
int (*bc_setup)(struct rpc_xprt *xprt,
unsigned int min_reqs);
int (*bc_up)(struct svc_serv *serv, struct net *net);
- struct svc_xprt *(*bc_get_xprt)(struct svc_serv *serv, struct net *net);
size_t (*bc_maxpayload)(struct rpc_xprt *xprt);
void (*bc_free_rqst)(struct rpc_rqst *rqst);
void (*bc_destroy)(struct rpc_xprt *xprt,
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 27685c0154b9..99968dec80cc 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1351,22 +1351,16 @@ int
bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
struct svc_rqst *rqstp)
{
- struct net *net = req->rq_xprt->xprt_net;
struct kvec *argv = &rqstp->rq_arg.head[0];
struct kvec *resv = &rqstp->rq_res.head[0];
struct rpc_task *task;
- struct svc_xprt *s_xprt;
int proc_error;
int error;
dprintk("svc: %s(%p)\n", __func__, req);
- s_xprt = req->rq_xprt->ops->bc_get_xprt(serv, net);
- if (!s_xprt)
- goto proc_error;
-
/* Build the svc_rqst used by the common processing routine */
- rqstp->rq_xprt = s_xprt;
+ rqstp->rq_xprt = serv->sv_bc_xprt;
rqstp->rq_xid = req->rq_xid;
rqstp->rq_prot = req->rq_xprt->prot;
rqstp->rq_server = serv;
@@ -1406,11 +1400,13 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
/* Parse and execute the bc call */
proc_error = svc_process_common(rqstp, argv, resv);
- svc_xprt_put(rqstp->rq_xprt);
atomic_inc(&req->rq_xprt->bc_free_slots);
- if (!proc_error)
- goto proc_error;
+ if (!proc_error) {
+ /* Processing error: drop the request */
+ xprt_free_bc_request(req);
+ return 0;
+ }
/* Finally, send the reply synchronously */
memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf));
@@ -1427,12 +1423,6 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req,
out:
dprintk("svc: %s(), error=%d\n", __func__, error);
return error;
-
-proc_error:
- /* Processing error: drop the request */
- xprt_free_bc_request(req);
- error = -EINVAL;
- goto out;
}
EXPORT_SYMBOL_GPL(bc_svc_process);
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
index 62da12efc837..87fa3a21b4c6 100644
--- a/net/sunrpc/xprtrdma/backchannel.c
+++ b/net/sunrpc/xprtrdma/backchannel.c
@@ -170,11 +170,6 @@ int xprt_rdma_bc_up(struct svc_serv *serv, struct net *net)
return 0;
}
-struct svc_xprt *xprt_rdma_bc_get_xprt(struct svc_serv *serv, struct net *net)
-{
- return svc_find_xprt(serv, "rdma-bc", net, AF_UNSPEC, 0);
-}
-
/**
* xprt_rdma_bc_maxpayload - Return maximum backchannel message size
* @xprt: transport
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 627681870e47..8c8e32b46eae 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -821,7 +821,6 @@ static struct rpc_xprt_ops xprt_rdma_procs = {
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
.bc_setup = xprt_rdma_bc_setup,
.bc_up = xprt_rdma_bc_up,
- .bc_get_xprt = xprt_rdma_bc_get_xprt,
.bc_maxpayload = xprt_rdma_bc_maxpayload,
.bc_free_rqst = xprt_rdma_bc_free_rqst,
.bc_destroy = xprt_rdma_bc_destroy,
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index 910121560a73..99c96bf33fce 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -663,7 +663,6 @@ void xprt_rdma_cleanup(void);
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
int xprt_rdma_bc_setup(struct rpc_xprt *, unsigned int);
int xprt_rdma_bc_up(struct svc_serv *, struct net *);
-struct svc_xprt *xprt_rdma_bc_get_xprt(struct svc_serv *serv, struct net *net);
size_t xprt_rdma_bc_maxpayload(struct rpc_xprt *);
int rpcrdma_bc_post_recv(struct rpcrdma_xprt *, unsigned int);
void rpcrdma_bc_receive_call(struct rpcrdma_xprt *, struct rpcrdma_rep *);
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 6e07e48c4ac8..e008aefc3a9d 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1411,12 +1411,6 @@ static int xs_tcp_bc_up(struct svc_serv *serv, struct net *net)
return 0;
}
-static struct svc_xprt *xs_tcp_bc_get_xprt(struct svc_serv *serv,
- struct net *net)
-{
- return svc_find_xprt(serv, "tcp-bc", net, AF_UNSPEC, 0);
-}
-
static size_t xs_tcp_bc_maxpayload(struct rpc_xprt *xprt)
{
return PAGE_SIZE;
@@ -2734,7 +2728,6 @@ static struct rpc_xprt_ops xs_tcp_ops = {
#ifdef CONFIG_SUNRPC_BACKCHANNEL
.bc_setup = xprt_setup_bc,
.bc_up = xs_tcp_bc_up,
- .bc_get_xprt = xs_tcp_bc_get_xprt,
.bc_maxpayload = xs_tcp_bc_maxpayload,
.bc_free_rqst = xprt_free_bc_rqst,
.bc_destroy = xprt_destroy_bc,
--
2.17.1
More information about the Devel
mailing list