Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3171189pxf; Sun, 21 Mar 2021 22:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEpszi4d184k3mhvVW/QDujwQ2vQn+UiB6NtzGeNUOiweAIEDoz3zYiNQtDMNcFntyeSMa X-Received: by 2002:a17:906:bccc:: with SMTP id lw12mr17135421ejb.268.1616391108862; Sun, 21 Mar 2021 22:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616391108; cv=none; d=google.com; s=arc-20160816; b=qzDJbHhInRvU0gytsmP4JhF6g9+efUT8yADQOOffl8q8ZC4MJnXrdRmVJkZ9G02f1K eZM97HRyDmNuF734WvMp7sl4MNHFkQh/sUiX538i1HAHEya67O7RUVf8zEFIuFPpr2lG 8bPiNCLgHWj0lysOXP0mhWzDwmN6xpipE5YlU21SBLAq9Cr8so1LhSPieD28MoW3uK40 oPgCTSa5k9NMzRhiA8ZI3Wlbi8z2zXfFsDkI2iezVDSFuSlqlT8MfmjJFn9G0hD0sR8K JPgWtUi6/TfVGPP/WPiv0L/KC6xm4SjSN9wQ6TMyyktpWVtBRRONf9W/BX3mEkZRF946 GPlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sD1MzNw7aGVvg6hOFiWwd/4vLjg8QeSoiZp24MRUDBI=; b=T4TYfE6rMK51Rfa60sGJ1KNRvAVe6KVb6cZwArmzo4zpNkpqIsU1pl5qg/84Brlc0Q 5vdxi8UrfvglGVByCLxmvpo8/i//h/xXeAF+fhLRnILmi0+qLPPVI/HZgXF4dqz2Xhfi z+zRYW5/gpruapSG2v28B6B5jfyvYuiBtDBUOrGt1lwCAzIKbRoT4H7ak3Wmg3IUt0Eu s20Pue/w/t4/LMAMqwm0tZYsI+SO2QMVLi6jqWrBNbQAKK8bzDR/WQnYl1GibjT/Gu5m DgfPMC1aua+BEbn+M/XRTPFwXX+i4ZJow1q2BQZr0RkufCAYdxUEI7mmefnKxf7zNygK r//g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si10468590eja.117.2021.03.21.22.31.27; Sun, 21 Mar 2021 22:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbhCVFaM (ORCPT + 99 others); Mon, 22 Mar 2021 01:30:12 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:55820 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbhCVF3i (ORCPT ); Mon, 22 Mar 2021 01:29:38 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=eguan@linux.alibaba.com;NM=1;PH=DS;RN=2;SR=0;TI=SMTPD_---0USrRB4D_1616390975; Received: from localhost(mailfrom:eguan@linux.alibaba.com fp:SMTPD_---0USrRB4D_1616390975) by smtp.aliyun-inc.com(127.0.0.1); Mon, 22 Mar 2021 13:29:36 +0800 From: Eryu Guan To: linux-nfs@vger.kernel.org Cc: Eryu Guan Subject: [PATCH 2/2] sunrpc: honor rpc_task's timeout value in rpcb_create() Date: Mon, 22 Mar 2021 13:29:04 +0800 Message-Id: <20210322052904.83508-2-eguan@linux.alibaba.com> X-Mailer: git-send-email 2.26.1.107.gefe3874 In-Reply-To: <20210322052904.83508-1-eguan@linux.alibaba.com> References: <20210322052904.83508-1-eguan@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- net/sunrpc/rpcb_clnt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 38fe2ce8a5aa..647b323cc1d5 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -344,13 +344,15 @@ static struct rpc_clnt *rpcb_create(struct net *net, const char *nodename, const char *hostname, struct sockaddr *srvaddr, size_t salen, int proto, u32 version, - const struct cred *cred) + const struct cred *cred, + const struct rpc_timeout *timeo) { struct rpc_create_args args = { .net = net, .protocol = proto, .address = srvaddr, .addrsize = salen, + .timeout = timeo, .servername = hostname, .nodename = nodename, .program = &rpcb_program, @@ -705,7 +707,8 @@ void rpcb_getport_async(struct rpc_task *task) clnt->cl_nodename, xprt->servername, sap, salen, xprt->prot, bind_version, - clnt->cl_cred); + clnt->cl_cred, + task->tk_client->cl_timeout); if (IS_ERR(rpcb_clnt)) { status = PTR_ERR(rpcb_clnt); goto bailout_nofree; -- 2.26.1.107.gefe3874