Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7758927rdb; Thu, 4 Jan 2024 06:58:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcTdDXN7dfMX4SyOUmPP8vU385fK8ReDeT8YbMDizCh5qjoxoqDQdIz5XWUwg+4t/7tq0M X-Received: by 2002:a17:906:2c50:b0:a23:62ed:105b with SMTP id f16-20020a1709062c5000b00a2362ed105bmr643599ejh.69.1704380338046; Thu, 04 Jan 2024 06:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704380338; cv=none; d=google.com; s=arc-20160816; b=SEvHrIgcXgX1kR6E6fKDcwwNzKvS+w40dRp3EnZB25Do3v8dEKc7vL0RGz6F6gSGtM VkLce+k04vLDjd5nGEXBVBQlOpxt4KbJY8ZNFEhO2KwQTiM+n5eZH8IgdAql0hAOd1Zh GyYl6hRdaj3Njd5wUWD6MFlXYuzr/miTO0ywCBAOTrebztJ+m3gbBnH9fgZ1/tuU1EXQ LwKpEjTiN9/alXm0lgmUEzaAaD4mhaB395SfYtGUBfnOsMOpbauOgTlJR9O7x7RHLn1X t+UAwIl9YOb30KndVNa+1r1PKDg6Pfa2MXhy4D0JSerSby86p5Wd2P45oiSBJ1Nk5nI4 TwfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=o3HzT6oh0+evacpeJS+Py+8urFr12rVnLTX2CVihH+I=; fh=sW0lCbFo/G93xnlnibH8a1nWtRL/lAadpRf/nf0jnbs=; b=ZlWTraCadmCI0Ef09dgvI053PzItc/a1R/8DCC/IiTVG7SOBUGMvgrdeignho42KVo Cwye8gMEW7rKN7QT1MdvkJpKZKn1VjpQf7nVomIS9V38Vi7UE7/p79h3/zWP+idJvlMX jN+7jd9P2PDNE5jsxw+labbkx4rIrL7SMbMplwd3Dxv7tgwKwp3Ksh0PDtMWAle/gVBE IqhYigtm8lyzGUZvsOG99T9ztZdrbWTOLaaDpypdydUnvS8e6OJhbAsLORMVxK1vc2Ls hJQ6r2Y+/eana8TmYnzvWicAVoRFyLMJpEk1BzaLTOeCBPqA98yImyWOiCX1TyM+z+x6 X6sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HPwdf2zP; spf=pass (google.com: domain of linux-nfs+bounces-934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c18-20020a170906529200b00a28c80df00asi807328ejm.496.2024.01.04.06.58.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 06:58:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HPwdf2zP; spf=pass (google.com: domain of linux-nfs+bounces-934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 980341F22950 for ; Thu, 4 Jan 2024 14:58:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 542C02375C; Thu, 4 Jan 2024 14:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HPwdf2zP" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D980723749 for ; Thu, 4 Jan 2024 14:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704380331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=o3HzT6oh0+evacpeJS+Py+8urFr12rVnLTX2CVihH+I=; b=HPwdf2zPaxSIXXTZ5p3cNxUXNQSXS+GQ4l4/r8TRHNa0LdVWcO4JgK2r4lUzozbxAqIGaV PG7tJdPqUF/XstV2EASZCR+nVfcj2ZVxVgoSGnWnW4qCNlftOtuKUgi4Pj4K08oMyZ7TNp wnTNCB10vMQ/SlN6BCXcWirGWNmLvg4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-379-WuIOmlqnMb2q-a_oXSAVng-1; Thu, 04 Jan 2024 09:58:48 -0500 X-MC-Unique: WuIOmlqnMb2q-a_oXSAVng-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9F4A83B8E9; Thu, 4 Jan 2024 14:58:47 +0000 (UTC) Received: from bcodding.csb.redhat.com (ovpn-0-5.rdu2.redhat.com [10.22.0.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBA40112131D; Thu, 4 Jan 2024 14:58:46 +0000 (UTC) From: Benjamin Coddington To: Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org Subject: [PATCH v4 1/2] SUNRPC: Fixup v4.1 backchannel request timeouts Date: Thu, 4 Jan 2024 09:58:45 -0500 Message-ID: Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 After commit 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out when on the sending list"), any 4.1 backchannel tasks placed on the sending queue would immediately return with -ETIMEDOUT since their req timers are zero. Initialize the backchannel's rpc_rqst timeout parameters from the xprt's default timeout settings. Fixes: 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out when on the sending list") Signed-off-by: Benjamin Coddington --- net/sunrpc/xprt.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 2364c485540c..6cc9ffac962d 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -651,9 +651,9 @@ static unsigned long xprt_abs_ktime_to_jiffies(ktime_t abstime) jiffies + nsecs_to_jiffies(-delta); } -static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req) +static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req, + const struct rpc_timeout *to) { - const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout; unsigned long majortimeo = req->rq_timeout; if (to->to_exponential) @@ -665,9 +665,10 @@ static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req) return majortimeo; } -static void xprt_reset_majortimeo(struct rpc_rqst *req) +static void xprt_reset_majortimeo(struct rpc_rqst *req, + const struct rpc_timeout *to) { - req->rq_majortimeo += xprt_calc_majortimeo(req); + req->rq_majortimeo += xprt_calc_majortimeo(req, to); } static void xprt_reset_minortimeo(struct rpc_rqst *req) @@ -675,7 +676,8 @@ static void xprt_reset_minortimeo(struct rpc_rqst *req) req->rq_minortimeo += req->rq_timeout; } -static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req) +static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req, + const struct rpc_timeout *to) { unsigned long time_init; struct rpc_xprt *xprt = req->rq_xprt; @@ -684,8 +686,9 @@ static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req) time_init = jiffies; else time_init = xprt_abs_ktime_to_jiffies(task->tk_start); - req->rq_timeout = task->tk_client->cl_timeout->to_initval; - req->rq_majortimeo = time_init + xprt_calc_majortimeo(req); + + req->rq_timeout = to->to_initval; + req->rq_majortimeo = time_init + xprt_calc_majortimeo(req, to); req->rq_minortimeo = time_init + req->rq_timeout; } @@ -713,7 +716,7 @@ int xprt_adjust_timeout(struct rpc_rqst *req) } else { req->rq_timeout = to->to_initval; req->rq_retries = 0; - xprt_reset_majortimeo(req); + xprt_reset_majortimeo(req, to); /* Reset the RTT counters == "slow start" */ spin_lock(&xprt->transport_lock); rpc_init_rtt(req->rq_task->tk_client->cl_rtt, to->to_initval); @@ -1886,7 +1889,7 @@ xprt_request_init(struct rpc_task *task) req->rq_snd_buf.bvec = NULL; req->rq_rcv_buf.bvec = NULL; req->rq_release_snd_buf = NULL; - xprt_init_majortimeo(task, req); + xprt_init_majortimeo(task, req, task->tk_client->cl_timeout); trace_xprt_reserve(req); } @@ -1996,6 +1999,8 @@ xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task) */ xbufp->len = xbufp->head[0].iov_len + xbufp->page_len + xbufp->tail[0].iov_len; + + xprt_init_majortimeo(task, req, req->rq_xprt->timeout); } #endif -- 2.43.0