diff options
author | J. Bruce Fields <bfields@redhat.com> | 2016-05-16 23:03:42 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-06-15 16:32:25 +0200 |
commit | d50039ea5ee63c589b0434baa5ecf6e5075bb6f9 (patch) | |
tree | 3f93ee65837cdd026d59c7b97ab5156a8aa08745 /net/sunrpc | |
parent | SUNRPC: fix xprt leak on xps allocation failure (diff) | |
download | linux-d50039ea5ee63c589b0434baa5ecf6e5075bb6f9.tar.xz linux-d50039ea5ee63c589b0434baa5ecf6e5075bb6f9.zip |
nfsd4/rpc: move backchannel create logic into rpc code
Also simplify the logic a bit.
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Trond Myklebust <trondmy@primarydata.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/clnt.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 173c5dd2d751..b33721d41adc 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -446,7 +446,7 @@ out_no_rpciod: return ERR_PTR(err); } -struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, +static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, struct rpc_xprt *xprt) { struct rpc_clnt *clnt = NULL; @@ -484,7 +484,6 @@ struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, return clnt; } -EXPORT_SYMBOL_GPL(rpc_create_xprt); /** * rpc_create - create an RPC client and transport with one call @@ -510,6 +509,15 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) }; char servername[48]; + if (args->bc_xprt) { + WARN_ON(args->protocol != XPRT_TRANSPORT_BC_TCP); + xprt = args->bc_xprt->xpt_bc_xprt; + if (xprt) { + xprt_get(xprt); + return rpc_create_xprt(args, xprt); + } + } + if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS) xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS; if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT) |