Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7662221ybl; Tue, 24 Dec 2019 06:37:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxhLWh01AtUhdusdKGYds0r2KBEPZdbFfJNcHfOYfCIVZNOl3jAUE64HdBhnPTNbAeoJwZ6 X-Received: by 2002:aca:d787:: with SMTP id o129mr771461oig.75.1577198271852; Tue, 24 Dec 2019 06:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577198271; cv=none; d=google.com; s=arc-20160816; b=SaH4LDPCMZlkQ5yoStBfqt/OMffOnHBAAR5VbOf0Wj/tR3prJX3NOH5hkAk7w7XvZj Fo0cpqxj7wQL5tS9Mu1kltWckxqNYT2ktrV1X8ySoB+2hKk2Msa6ydJbCIb2XWs7IGMA tJ8Ziv8hdc57PHjqHfPOBOjUxXjBzH8MwrWnKb0Uq69X/1w/vfGgjbICHducm19njbDr Un8qCYhIaMEwSPbWX9hI4/c7Q5LGdyU/DZEPEMO+EQhbgeU4SsH4gngtAuRhgVAGFWkP 4pqpiieShcnHEhpwqRHDH4xTYjB5eXMpkmgHBMpGl3BdxnMjv8B9myw6ERYcMI34scUv 9Qcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=/+YjS98Z9lwGK4xAtM+uHlhw7vC65cvgwuOwRf+cKv8=; b=eFbKxw31vBQU6wRZ8X47mnYi7JG4WMrkC90gHa8db4VpdDcUmrPcwGZte4cnjzLO4J Jpz8s1xFILpgMitcaG83x1vjelIASboXsWzr1QWqBVpAx4p5V4kZ1tnydLIHBsTFWA6O tAo75kltSfHr411xW4x01t/feowDUOwRcy070I4Aq7UTn4ZpAxUwIX0Yq0cMynAIFq04 eahfIqU1S8YuV3Cdy3ihIveeClk3JrYerHJx0Is/3hdzgTJYl0NWIeNzXF2svBy4Co9V io7+LGO6RYohCp0LMd/K2fRvP3aeFQKnpzswl6Tmm6+vVnqF1rhZaWTuMz/RFDgy0Tlc Ktkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LcXQ49j9; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l78si3499324oih.182.2019.12.24.06.37.27; Tue, 24 Dec 2019 06:37:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LcXQ49j9; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbfLXOgf (ORCPT + 99 others); Tue, 24 Dec 2019 09:36:35 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34000 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfLXOge (ORCPT ); Tue, 24 Dec 2019 09:36:34 -0500 Received: by mail-lj1-f193.google.com with SMTP id z22so16160260ljg.1; Tue, 24 Dec 2019 06:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=/+YjS98Z9lwGK4xAtM+uHlhw7vC65cvgwuOwRf+cKv8=; b=LcXQ49j9nMxaAtMUCiy3D861QVGqLzjtMMfejFuiI+WrDjyKPrpMqBwCK7/aFRcGY4 rB1dIwxRW/onbueUeIAvymTVf2tW07/AwwMVX7Tb800xESyXk78lquiC1/tTUAikbJ3z BeVkICbxoxOUeHepLe+X0JwzcRwocJJ75qIV9g4Ad/VodgHtyGWrHi0wSjGcnvLPw3+a 8jLJ4K7/l144SBDNBgMFU/kGqq2th507b4Or36PCWO6HL7z6p/STai8r49PxZb20I6y+ 5/fXTZoVrF7Yye9sKTt53r8uqZ5ZPze9xiOunKs+upP2ig9RP0OMolYj9q18hJwupr+8 m1IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=/+YjS98Z9lwGK4xAtM+uHlhw7vC65cvgwuOwRf+cKv8=; b=EwfWNCnlApzsZ7WVu65eciFckrT/3i+6sE3v3g7+Y5UHhuRqTIG5lP5s/PU0n138KL Z/PndXchoWIOMQYQbUXZPPkaNz2B0h8SFSoY2dMlGY1hLGixevACdwStib12+fbZREvD zBOv8XFgW0+m26G3aKA0o9Vnpx+/tnZ1XUGlMTSa1CFJFXO7w90Ru0iC0yvVUQ18BAmH LON7MfPs7nCgGmgjKJ4wJYzDOChyMd/3T8gXiqIF8zUyK6uVVyT+mbAdJDf49HfasEwy oGiPNe0FFfMzuUCgahUnjBCLbaqH9J2IKHQrTOCMIPI2umwSMkZtz0+2rEit0XdYQC8A fo6Q== X-Gm-Message-State: APjAAAU3P/tK3jVt2ABJ/Joyi9W0BFNJ0+2CLdDUAo9myKkP0NfDwFCk vatZqOKvBgVLA5lQ43dgjZxqtXxEarM= X-Received: by 2002:a2e:b1c3:: with SMTP id e3mr20781533lja.137.1577198192208; Tue, 24 Dec 2019 06:36:32 -0800 (PST) Received: from loulrmilkow1 (227.46-29-148.tkchopin.pl. [46.29.148.227]) by smtp.gmail.com with ESMTPSA id l22sm5539885ljj.44.2019.12.24.06.36.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Dec 2019 06:36:31 -0800 (PST) From: "Robert Milkowski" To: Cc: "'Trond Myklebust'" , "'Anna Schumaker'" , Subject: [PATCH v2] NFSv4.0: nfs4_do_fsinfo() should not do implicit lease Date: Tue, 24 Dec 2019 14:36:31 -0000 Message-ID: <001901d5ba67$8954ede0$9bfec9a0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdW6ZxKSwNGVh9l6R3GFPFG08PYEHA== Content-Language: en-gb Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Robert Milkowski Currently, each time nfs4_do_fsinfo() is called it will do an implicit NFS4 lease renewal, which is not compliant with the NFS4 specification. This can result in a lease being expired by an NFS server. Signed-off-by: Robert Milkowski --- fs/nfs/nfs4proc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 76d3716..b6cad9a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5016,19 +5016,23 @@ static int _nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *fsinfo) { + struct nfs_client *clp = server->nfs_client; struct nfs4_exception exception = { .interruptible = true, }; - unsigned long now = jiffies; + unsigned long last_renewal = jiffies; int err; do { err = _nfs4_do_fsinfo(server, fhandle, fsinfo); trace_nfs4_fsinfo(server, fhandle, fsinfo->fattr, err); if (err == 0) { - nfs4_set_lease_period(server->nfs_client, + /* no implicit lease renewal allowed here for v4.0 */ + if (clp->cl_minorversion == 0 && clp->cl_last_renewal != 0) + last_renewal = clp->cl_last_renewal; + nfs4_set_lease_period(clp, fsinfo->lease_time * HZ, - now); + last_renewal); break; } err = nfs4_handle_exception(server, err, &exception); -- 1.8.3.1