mirror of https://gitee.com/openkylin/linux.git
sunrpc: honor rpc_task's timeout value in rpcb_create()
Currently rpcbind client is created without setting rpc timeout (thus using the default value). But if the rpc_task already has a customized timeout in its tk_client field, it's also ignored. Let's use the same timeout setting in rpc_task->tk_client->cl_timeout for rpcbind connection. Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
90ff57bf4d
commit
6b996476f3
|
@ -344,13 +344,15 @@ static struct rpc_clnt *rpcb_create(struct net *net, const char *nodename,
|
||||||
const char *hostname,
|
const char *hostname,
|
||||||
struct sockaddr *srvaddr, size_t salen,
|
struct sockaddr *srvaddr, size_t salen,
|
||||||
int proto, u32 version,
|
int proto, u32 version,
|
||||||
const struct cred *cred)
|
const struct cred *cred,
|
||||||
|
const struct rpc_timeout *timeo)
|
||||||
{
|
{
|
||||||
struct rpc_create_args args = {
|
struct rpc_create_args args = {
|
||||||
.net = net,
|
.net = net,
|
||||||
.protocol = proto,
|
.protocol = proto,
|
||||||
.address = srvaddr,
|
.address = srvaddr,
|
||||||
.addrsize = salen,
|
.addrsize = salen,
|
||||||
|
.timeout = timeo,
|
||||||
.servername = hostname,
|
.servername = hostname,
|
||||||
.nodename = nodename,
|
.nodename = nodename,
|
||||||
.program = &rpcb_program,
|
.program = &rpcb_program,
|
||||||
|
@ -705,7 +707,8 @@ void rpcb_getport_async(struct rpc_task *task)
|
||||||
clnt->cl_nodename,
|
clnt->cl_nodename,
|
||||||
xprt->servername, sap, salen,
|
xprt->servername, sap, salen,
|
||||||
xprt->prot, bind_version,
|
xprt->prot, bind_version,
|
||||||
clnt->cl_cred);
|
clnt->cl_cred,
|
||||||
|
task->tk_client->cl_timeout);
|
||||||
if (IS_ERR(rpcb_clnt)) {
|
if (IS_ERR(rpcb_clnt)) {
|
||||||
status = PTR_ERR(rpcb_clnt);
|
status = PTR_ERR(rpcb_clnt);
|
||||||
goto bailout_nofree;
|
goto bailout_nofree;
|
||||||
|
|
Loading…
Reference in New Issue