Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp505346pxv; Wed, 14 Jul 2021 08:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOiRNDyILdgril6MT3QPBgXv7GZRK0uk+/8PLVoKePgcfUOJKb/px+O7g6lWUarxUM6iNh X-Received: by 2002:a17:906:76cf:: with SMTP id q15mr13068702ejn.69.1626278000006; Wed, 14 Jul 2021 08:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626277999; cv=none; d=google.com; s=arc-20160816; b=qP+rdB/Pi9AZ2g7/vPj0j9WWODuY+OPvEy5RsdxAe+H+9DLTxq7bs0NPfou+uPvXAn XujnXSTRohYiqXtAEpdHA7JYFJIEzYDnGMyhRgtbzq+Y4sJ69wwxn63yzY2eQzOxUx7B JQHY5fGwXqfiXMtS+1XsQiucnodggi/YEAZHl7inAll7M7+rrwuIKdQNHR1DcIBRvc8y /tfDQ1/2ZePBZfiwnMp/4ATkCH0bKpwbWZ2oBMXcbi8t5YvmmG/Yjz9T5yraq+9aaUdi HC8ETtLCxeBOriLtdqWE2RnNu2geYpDsKquIuBujmI7hL59jqPbIyRn7nzk8U6gZr8Kj dLYQ== 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 :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=r3/t7KhScJWo11adijrFOLv+az63QtgRplaxr7lIzBU=; b=jh5wkrYeeGvRiLZaH4UYUj2IxOu0xI7e7FPsdCm+3Vq3X813Jdw0/v1x1UPI8TWurv ARDjbrO9HgyLqf2iuV22DKqHcywi17q7/2iIluVdsdt5bPOjNkRqiu+VqOtk6v+qxjW9 BYIXzNuKOMChCzm2eGxvk5Wbrlin10EQ3QCUAfq5Ui3JFoCHuSsqT4xGYD3nSViLboMj PCSF41rQi4gv7VJ41vO87uT8rbBRo7llVuGgA/NvNkdxULQ72+8ZXaWPqdcKJN6aZ/0o KjYlLGShkD41+z6ZaA/llPAs8r7u9MArDXF/IfOXRktKq3lTajgP4x9wzjVnZhY5e8jx aWhw== 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si3051261edu.26.2021.07.14.08.52.56; Wed, 14 Jul 2021 08:53:19 -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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239748AbhGNPxK (ORCPT + 99 others); Wed, 14 Jul 2021 11:53:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239674AbhGNPxK (ORCPT ); Wed, 14 Jul 2021 11:53:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D18A6128D for ; Wed, 14 Jul 2021 15:50:18 +0000 (UTC) Subject: [PATCH RFC 1/4] NFS: Unset RPC_TASK_NO_RETRANS_TIMEOUT for async lease renewal From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Wed, 14 Jul 2021 11:50:17 -0400 Message-ID: <162627781762.1294.17862468684529354297.stgit@manet.1015granger.net> In-Reply-To: <162627611661.1294.9189768423517916152.stgit@manet.1015granger.net> References: <162627611661.1294.9189768423517916152.stgit@manet.1015granger.net> User-Agent: StGit/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org In some rare failure modes, the server is actually reading the transport, but then just dropping the requests on the floor. TCP_USER_TIMEOUT cannot detect that case. Prevent such a stuck server from pinning client resources indefinitely by ensuring that async lease renewal requests can time out even if the connection is still operational. Signed-off-by: Chuck Lever --- fs/nfs/nfs4proc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e1214bb6b7ee..346217f6a00b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5612,6 +5612,12 @@ struct nfs4_renewdata { * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special * standalone procedure for queueing an asynchronous RENEW. */ +static void nfs4_renew_prepare(struct rpc_task *task, void *calldata) +{ + task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; + rpc_call_start(task); +} + static void nfs4_renew_release(void *calldata) { struct nfs4_renewdata *data = calldata; @@ -5650,6 +5656,7 @@ static void nfs4_renew_done(struct rpc_task *task, void *calldata) } static const struct rpc_call_ops nfs4_renew_ops = { + .rpc_call_prepare = nfs4_renew_prepare, .rpc_call_done = nfs4_renew_done, .rpc_release = nfs4_renew_release, }; @@ -9219,6 +9226,8 @@ static void nfs41_sequence_prepare(struct rpc_task *task, void *data) struct nfs4_sequence_args *args; struct nfs4_sequence_res *res; + task->tk_flags &= ~RPC_TASK_NO_RETRANS_TIMEOUT; + args = task->tk_msg.rpc_argp; res = task->tk_msg.rpc_resp;