From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,
	SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 27DD9C43603
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 17:38:10 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id ECF9A206D7
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 17:38:09 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CMxXZ1Nt"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726515AbfLPRiI (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 12:38:08 -0500
Received: from mail-wr1-f65.google.com ([209.85.221.65]:41344 "EHLO
        mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1726227AbfLPRiH (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 12:38:07 -0500
Received: by mail-wr1-f65.google.com with SMTP id c9so8343193wrw.8;
        Mon, 16 Dec 2019 09:38:05 -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=YvwLWoXK+n4PBW3H7wU0kExV6V4+NJ7KeyyLrWDeEGo=;
        b=CMxXZ1NtTTIx6YqNzhPhEugHnuxKG56T7KZImLeaVY633que16ESIFstZ5I5qOYHhL
         mJ7S7DANV3z2+N8aIcPkPIQB46EqTfDUL9ZXVXqMez4Ru7ocJDdqHz9GrjGF3izni233
         QgAUjsd7HbFMKooEmkVXlSt5/bVBHDfqzna1pD9H2EVB/XhFRRJcjH69ZuLYs99AbaAa
         1ue9SOV0Mp8dDSU2cPZP2B8PKt0jKPRktpKDvrNq1QuJKsNBajFlxYfzekAjDbr6M0YT
         RGF6cSZM0VWcXYij016AKa7TtCpqjW03VbTZs7TCx59aF+BZcdP+rMavzeZWolx6oXXG
         Prhw==
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=YvwLWoXK+n4PBW3H7wU0kExV6V4+NJ7KeyyLrWDeEGo=;
        b=g47nUDj9YOO32CzDLyneYl6LmMJ/CHn2bwSuCfKMrLEn5lKvtE5T8OZT3NmPc/W23f
         36FcOYfdjuGZVE0gryy7MpNqfB2/8ZefhsVk/F1cGbdm+Pla2abKIO1N1JpHcJCHFfG2
         6w/UPG8LjINISsR104CPrsK2QQGfAmw4dv7/aLhuHX01zUrowPZbnR2VnhKUyKUhu6qF
         8BCFJ37pCHaqu4XDdgMG53yfJ6gYfIKFm42OGKgzXbTpD2sFTsgUYZAv+3Xu4RaibGWg
         6NoDmJzgyT2wj+Eaq6du4Fzk4PPhSp4k6xcNUW3iCz//OaI+X9tFPcH4Hix9dEDD3IW0
         Gvqw==
X-Gm-Message-State: APjAAAW4UYbTCuiqU+gsYkykhTpT6jHRat4wXhYw0jTQ9Qu//b0c4fCD
        6nvUR/QoaMBGhM1LW1rl/26Np6FRLdk=
X-Google-Smtp-Source: APXvYqyiSjvep2p8o7WWZtUnyRyUhcxLDzNoUHzUhtMm9Jj/4aJftF26uKd+u5BhlkfcXe7OHM7feg==
X-Received: by 2002:a5d:494f:: with SMTP id r15mr33137175wrs.143.1576517884942;
        Mon, 16 Dec 2019 09:38:04 -0800 (PST)
Received: from WINDOWSSS5SP16 (cpc96954-walt26-2-0-cust383.13-2.cable.virginm.net. [82.31.89.128])
        by smtp.gmail.com with ESMTPSA id v8sm22059274wrw.2.2019.12.16.09.38.03
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 16 Dec 2019 09:38:04 -0800 (PST)
From:   "Robert Milkowski" <rmilkowski@gmail.com>
To:     <linux-nfs@vger.kernel.org>
Cc:     "'Trond Myklebust'" <trond.myklebust@hammerspace.com>,
        "'Anna Schumaker'" <anna.schumaker@netapp.com>,
        <linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>
Subject: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
Date:   Mon, 16 Dec 2019 17:38:03 -0000
Message-ID: <056501d5b437$91f1c6c0$b5d55440$@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: AdW0MytZJzbanD9yTZ+e0zLvCdtxJA==
Content-Language: en-gb
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

From: Robert Milkowski <rmilkowski@gmail.com>

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 NFS server which will then
return NFS4ERR_EXPIRED or NFS4ERR_STALE_CLIENTID.

Signed-off-by: Robert Milkowski <rmilkowski@gmail.com>
---
 fs/nfs/nfs4proc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 76d3716..aad65dd 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5019,16 +5019,19 @@ static int nfs4_do_fsinfo(struct nfs_server *server,
struct nfs_fh *fhandle, str
 	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) {
+			/* no implicit lease renewal allowed here */
+			if (server->nfs_client->cl_last_renewal != 0)
+				last_renewal =
server->nfs_client->cl_last_renewal;
 			nfs4_set_lease_period(server->nfs_client,
 					fsinfo->lease_time * HZ,
-					now);
+					last_renewal);
 			break;
 		}
 		err = nfs4_handle_exception(server, err, &exception);
-- 
1.8.3.1



From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,
	SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no
	version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id CA22AC43603
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:24:49 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id 981B0206E0
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:24:49 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (1024-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b="d6zgnrFu"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1732139AbfLPSYs (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:24:48 -0500
Received: from mail-eopbgr700101.outbound.protection.outlook.com ([40.107.70.101]:5344
        "EHLO NAM04-SN1-obe.outbound.protection.outlook.com"
        rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP
        id S1732052AbfLPSYo (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:24:44 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=YHujkp7CVVUQ8P3v7tV3AFFHghGlqfYv6Q05yNJPDnjtXzMp3kfxyhvw2sg9fNlj4obtYg+KOc2yyi6Vjnc1UtDERxdnEpnVhm8Zs60DwfPP8/d/2cw2D+BOFOvWbQsCOX1M/V2sSos38hz0ppx4z6HYqnan8w28GsNiWWKGnoof5zI70CVYIhhU11Q+ivUxxdThW/V5vVNT+Nh2nFXeadUFfyQ3OYs2/T6KYWtHH64urNLLOzZ/DLxaNtgwAYZdBE7GauMQzFd1CKEXkUGGXVIxYSNkjgzg69gW0LjoKXho3ggLhas1xuKOVkXOTCK44vVIHqheKdJ47jaxflMhYA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/0fhl52scLtKcu/Z3lmmF87F0BKFSk7u7oqP+jP2hss=;
 b=IgAgf57RhOgg9uPLhFQiXJ7Ky6S6Ddhxg0IQ9KFuG2jPYMvEqCOM/Zbg7Qyt79JTv4Oy2jDadgvFcg1D2SHWAS/8gLhrtfKpih5oVwo42Q3cWpEmmQt4g8mTRGvQhxkwzzGupKhamyZFjbNYMA2skKCIKem54EkVLaDD1FQsDBZ6bGb3z7b3XdzjAJ7rB48V4+In+7Fq9bVEyOR0JmSLJSHJCws8xo73w2B+fCJPR7zwk7+IXGJa7CwP8fkoCyewXvribMRKJgrFbzmtycN6SGEfEeE2LhGjcEXL48yc7d6Tk7GZ39g6UCwJVfd034un3b5Zsex+EHWDBHcsSE0PUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=hammerspace.com; dmarc=pass action=none
 header.from=hammerspace.com; dkim=pass header.d=hammerspace.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/0fhl52scLtKcu/Z3lmmF87F0BKFSk7u7oqP+jP2hss=;
 b=d6zgnrFu9bwcow02H/COZ92NZvqNya/fszdSOjb/wT8B9BLx4kHH5yK1UlMkZ2bTlbbeLEray3j3uso6KhIpsci/Y/A4XkPfo1WiDsAxWZng1nBMaeJg0Dw9D9VUEUKJvm0LQFR3dOnPIBONl7eOSHwKtKMSZfktFcjWDYt7Jcc=
Received: from DM5PR1301MB2108.namprd13.prod.outlook.com (10.174.186.34) by
 DM5PR1301MB2060.namprd13.prod.outlook.com (10.174.186.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2559.8; Mon, 16 Dec 2019 18:24:40 +0000
Received: from DM5PR1301MB2108.namprd13.prod.outlook.com
 ([fe80::2d23:b456:d67:f230]) by DM5PR1301MB2108.namprd13.prod.outlook.com
 ([fe80::2d23:b456:d67:f230%6]) with mapi id 15.20.2559.012; Mon, 16 Dec 2019
 18:24:39 +0000
From:   Trond Myklebust <trondmy@hammerspace.com>
To:     "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
        "rmilkowski@gmail.com" <rmilkowski@gmail.com>
CC:     "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
        "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease
 renewals
Thread-Topic: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease
 renewals
Thread-Index: AdW0MytZJzbanD9yTZ+e0zLvCdtxJAACuc6A
Date:   Mon, 16 Dec 2019 18:24:39 +0000
Message-ID: <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
In-Reply-To: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=trondmy@hammerspace.com; 
x-originating-ip: [68.40.189.247]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: da240dad-5650-4da3-4458-08d78255369f
x-ms-traffictypediagnostic: DM5PR1301MB2060:
x-microsoft-antispam-prvs: <DM5PR1301MB206066E3505DC18C6523B300B8510@DM5PR1301MB2060.namprd13.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:6430;
x-forefront-prvs: 02530BD3AA
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39840400004)(136003)(396003)(346002)(376002)(189003)(199004)(66946007)(64756008)(66446008)(4001150100001)(6512007)(66556008)(66476007)(36756003)(76116006)(316002)(54906003)(110136005)(71200400001)(2906002)(81166006)(6506007)(2616005)(86362001)(5660300002)(186003)(8676002)(4326008)(6486002)(81156014)(8936002)(508600001)(26005);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR1301MB2060;H:DM5PR1301MB2108.namprd13.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1;
received-spf: None (protection.outlook.com: hammerspace.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 5vR7QDjBEe6tY4bm4B+qWigmsw+/P9qzKlnfM+BnZKXc2IP58IesYE6DhmKaV0N4GUl+8tWQ38TJ9mYT+/xTuCnblJF44hUL79dIKxlX1qXlQKc2eGrf5+vPAcnfpP8hHJizZ3Q7NT5pLShVaFLlBbWYrtSJSQlIjZy6f+Lhj8SzAu1GMjiRTyGn5Oj7243tHrODGne56X+cXaSFsSrzoSrsx6HRSSELc1FOvr0BYzSIGLh+bumfDjdV+xu9kiCSXCnOJkPocqxKC5xIzuA0zC6+gsd7j57k89YWcYeWCYfOXz9fXNrQlZjCoi7dZ6T6y2YiG1ucdTpvSrev5ZfNpUqftd4EHIvHD1s8kE2VZ8wZWmjuiii9OjGogdCpxFaK1t7ROHCV4f+yU/79axBPea1mIFCyNTtyEFzO9Ch0JaYTorCH7gAiPQ27g3VR1yyA
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-ID: <5778E02CA2275C47AE02D3E15C6799A9@namprd13.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: hammerspace.com
X-MS-Exchange-CrossTenant-Network-Message-Id: da240dad-5650-4da3-4458-08d78255369f
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 18:24:39.4963
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0d4fed5c-3a70-46fe-9430-ece41741f59e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: zGZ7oru2Q8L9bxpTRJsaob7+q9vzNl+cuLHvqoglhgoT0KCopsPgxepA6f9tU0h0fc6kU/el73ThrXvFF5b1bg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1301MB2060
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

T24gTW9uLCAyMDE5LTEyLTE2IGF0IDE3OjM4ICswMDAwLCBSb2JlcnQgTWlsa293c2tpIHdyb3Rl
Og0KPiBGcm9tOiBSb2JlcnQgTWlsa293c2tpIDxybWlsa293c2tpQGdtYWlsLmNvbT4NCj4gDQo+
IEN1cnJlbnRseSwgZWFjaCB0aW1lIG5mczRfZG9fZnNpbmZvKCkgaXMgY2FsbGVkIGl0IHdpbGwg
ZG8gYW4NCj4gaW1wbGljaXQNCj4gTkZTNCBsZWFzZSByZW5ld2FsLCB3aGljaCBpcyBub3QgY29t
cGxpYW50IHdpdGggdGhlIE5GUzQNCj4gc3BlY2lmaWNhdGlvbi4NCj4gVGhpcyBjYW4gcmVzdWx0
IGluIGEgbGVhc2UgYmVpbmcgZXhwaXJlZCBieSBORlMgc2VydmVyIHdoaWNoIHdpbGwNCj4gdGhl
bg0KPiByZXR1cm4gTkZTNEVSUl9FWFBJUkVEIG9yIE5GUzRFUlJfU1RBTEVfQ0xJRU5USUQuDQo+
IA0KPiBTaWduZWQtb2ZmLWJ5OiBSb2JlcnQgTWlsa293c2tpIDxybWlsa293c2tpQGdtYWlsLmNv
bT4NCj4gLS0tDQo+ICBmcy9uZnMvbmZzNHByb2MuYyB8IDcgKysrKystLQ0KPiAgMSBmaWxlIGNo
YW5nZWQsIDUgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkNCj4gDQo+IGRpZmYgLS1naXQg
YS9mcy9uZnMvbmZzNHByb2MuYyBiL2ZzL25mcy9uZnM0cHJvYy5jDQo+IGluZGV4IDc2ZDM3MTYu
LmFhZDY1ZGQgMTAwNjQ0DQo+IC0tLSBhL2ZzL25mcy9uZnM0cHJvYy5jDQo+ICsrKyBiL2ZzL25m
cy9uZnM0cHJvYy5jDQo+IEBAIC01MDE5LDE2ICs1MDE5LDE5IEBAIHN0YXRpYyBpbnQgbmZzNF9k
b19mc2luZm8oc3RydWN0IG5mc19zZXJ2ZXINCj4gKnNlcnZlciwNCj4gc3RydWN0IG5mc19maCAq
ZmhhbmRsZSwgc3RyDQo+ICAJc3RydWN0IG5mczRfZXhjZXB0aW9uIGV4Y2VwdGlvbiA9IHsNCj4g
IAkJLmludGVycnVwdGlibGUgPSB0cnVlLA0KPiAgCX07DQo+IC0JdW5zaWduZWQgbG9uZyBub3cg
PSBqaWZmaWVzOw0KPiArCXVuc2lnbmVkIGxvbmcgbGFzdF9yZW5ld2FsID0gamlmZmllczsNCj4g
IAlpbnQgZXJyOw0KPiAgDQo+ICAJZG8gew0KPiAgCQllcnIgPSBfbmZzNF9kb19mc2luZm8oc2Vy
dmVyLCBmaGFuZGxlLCBmc2luZm8pOw0KPiAgCQl0cmFjZV9uZnM0X2ZzaW5mbyhzZXJ2ZXIsIGZo
YW5kbGUsIGZzaW5mby0+ZmF0dHIsIGVycik7DQo+ICAJCWlmIChlcnIgPT0gMCkgew0KPiArCQkJ
Lyogbm8gaW1wbGljaXQgbGVhc2UgcmVuZXdhbCBhbGxvd2VkIGhlcmUgKi8NCj4gKwkJCWlmIChz
ZXJ2ZXItPm5mc19jbGllbnQtPmNsX2xhc3RfcmVuZXdhbCAhPSAwKQ0KPiArCQkJCWxhc3RfcmVu
ZXdhbCA9DQo+IHNlcnZlci0+bmZzX2NsaWVudC0+Y2xfbGFzdF9yZW5ld2FsOw0KPiAgCQkJbmZz
NF9zZXRfbGVhc2VfcGVyaW9kKHNlcnZlci0+bmZzX2NsaWVudCwNCj4gIAkJCQkJZnNpbmZvLT5s
ZWFzZV90aW1lICogSFosDQo+IC0JCQkJCW5vdyk7DQo+ICsJCQkJCWxhc3RfcmVuZXdhbCk7DQo+
ICAJCQlicmVhazsNCj4gIAkJfQ0KPiAgCQllcnIgPSBuZnM0X2hhbmRsZV9leGNlcHRpb24oc2Vy
dmVyLCBlcnIsICZleGNlcHRpb24pOw0KDQpOQUNLLiBUaGUgYWJvdmUgYXJndW1lbnQgb25seSBh
cHBsaWVzIHRvIGxlZ2FjeSBtaW5vciB2ZXJzaW9uIDAgc2V0dXBzLA0KYW5kIGRvZXMgbm90IGFw
cGx5IHRvIE5GU3Y0LjEgb3IgbmV3ZXIuDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBO
RlMgY2xpZW50IG1haW50YWluZXIsIEhhbW1lcnNwYWNlDQp0cm9uZC5teWtsZWJ1c3RAaGFtbWVy
c3BhY2UuY29tDQoNCg0K

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id CC0F9C43603
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:36:28 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id A4E1F20733
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:36:28 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WJc4xur6"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1729782AbfLPSg2 (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:36:28 -0500
Received: from mail-wr1-f48.google.com ([209.85.221.48]:37893 "EHLO
        mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1729173AbfLPSgZ (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:36:25 -0500
Received: by mail-wr1-f48.google.com with SMTP id y17so8549802wrh.5;
        Mon, 16 Dec 2019 10:36:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=n2qqlU8y47E11EtZZTk3mdHYschbNhKlAx4Tv92JWbw=;
        b=WJc4xur6U3glMB60pMU4XO9v+245vNsJytGPjYbg0LwblPPkJa1HSeemsmLFiFcpCn
         LAcyh1ukqB7WKa1n4vl8sE2Ya4GaKFSabh5rx+Xsk7GjtE+msa3BVGMb0uqPsqHOsDvS
         q6r9553ITNyW0GTqZ+d8/3ay/tBmKMSso2HbWCgsWpNJTdNJREXLnGQFl7L+LgzsUFgn
         10RZn2z+/Cg9/MTMV9rE0OhMF53lCryofs7Eg+2oZrDU21Vt3BC1cdNU/WWv3SgmWmgd
         j202Sy/DO/vXTuIOT++IQ75saKOlxobMplE1P2VBAQwKlJ8OkzWi8dr3rnXprzlPkSgL
         H3mQ==
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:references:in-reply-to:subject:date
         :message-id:mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=n2qqlU8y47E11EtZZTk3mdHYschbNhKlAx4Tv92JWbw=;
        b=qMHnKgNV1HoFjvxKaPLcetx8B8tKqFn6jVAn01xi7F23cU67rZMWqndiIY+3PAOjnN
         +oofNHpjphW1FfOW7uWffQMzyPq2/3P47M6yxO2QLYO0t0HTSWFi6B2enl6L75cWR9jW
         5lCsKP+O0P+NCrBbRmyFoq6VldzVM6PHYVVQT4hR++P+3tTLzjqBbr1iK61iTHjCbXk+
         EWLEBvMpuiQrOVfwGRHiNwZj8dqsIIRHWUxUtR4NV1IJftmN1lRmV13RDdabfmms9FRP
         0NoEdU6FeRcmLnZ2wRidT3KNy/s3YQvyob7X6vNIPWaJCpvX1ING4cHxsGpQ2GcFAGdR
         Zhvw==
X-Gm-Message-State: APjAAAUFgahkqN0Zb6439+8P+BIiXXCgAlXX8JdSkqTd3/jqLjrYv1aq
        bSL44XsYECqeBEbpTP8Eoqk=
X-Google-Smtp-Source: APXvYqyJvxNWgk08b47ovHhUu1IK6g2hbNz1Tr/JugUMGcQRPeifWcr/kX2LSUSLw3+7+9D2S76wfg==
X-Received: by 2002:adf:93c6:: with SMTP id 64mr30320970wrp.212.1576521384254;
        Mon, 16 Dec 2019 10:36:24 -0800 (PST)
Received: from WINDOWSSS5SP16 (cpc96954-walt26-2-0-cust383.13-2.cable.virginm.net. [82.31.89.128])
        by smtp.gmail.com with ESMTPSA id o7sm260635wmh.11.2019.12.16.10.36.23
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 16 Dec 2019 10:36:23 -0800 (PST)
From:   "Robert Milkowski" <rmilkowski@gmail.com>
To:     <linux-nfs@vger.kernel.org>
Cc:     "'Trond Myklebust'" <trond.myklebust@hammerspace.com>,
        "'Anna Schumaker'" <anna.schumaker@netapp.com>,
        <linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
In-Reply-To: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
Subject: RE: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
Date:   Mon, 16 Dec 2019 18:36:23 -0000
Message-ID: <05cd01d5b43f$b7d88f60$2789ae20$@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: AQIkbnQjyymuSgNjdVHy4DQRhOG+0qcfnHIA
Content-Language: en-gb
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

Hi,

If a sub-filesystem (nfsv4 mirror mount) gets unmounted and then mounted
again (by accessing it) the nfs4_do_fsinfo() function is called,
which currently assumes implicit lease renewal. I believe this is no
compliant with the RFC.

I've managed to trigger the issue by two different methods:

1) in prod

If there is an NFSv4 filesystem mounted with sub-mounts (similar setup as
below), after nfs_mountpoint_expiry_timeout of inactivity, 
Each submount will be unmounted. If now it gets accessed again it will be
automatically mounted again which will result currently
in implicit lease renewal on the client side which in turn can result in a
relatively small window where the client thinks its lease
is still valid while an nfs server has already expired the lease.

2) manual unmount

# cat /etc/exports
/ *(rw,sync)
/var *(rw,sync)


On a Linux NFS client:

# mount -o vers=4 10.50.2.59:/ /mnt/3
$ head /mnt/3/var/log/vmware-vmsvc.log >/dev/null
$ df -h | tail -2
10.50.2.59:/                                                  29G   25G
2.3G  92% /mnt/3
10.50.2.59:/var                                               20G  2.2G
16G  13% /mnt/3/var

# while [ 1 ]; do date; umount /mnt/3/var; ls /mnt/3/var >/dev/null; sleep
10; done
...

By constantly unmounting the sub-filesystem (/var) and then accessing it so
it gets mounted again (which triggers the nfs4_do_fsinfo()),
the cl_last_renewal is set to now on the client which prevents RENEW
operations from being send, and eventually the NFS server
will expire the lease (common defaults are 60s on Linux and 90s on Solaris
servers).

In testing I confirmed that both Linux and Solaris NFSv4 servers will not do
an implicit lease renewal in this case
(nfs4_do_fsinfo() results in GETATTR operations being send), in which case
the lease might expire and both Linux and Solaris
NFS servers will return NFS4ERR_EXPIRED.

The error is not handled correctly either and will result in EIO propagated
to an application issuing open().
See my other email with subject: [PATCH] NFSv4: open() should try lease
recovery on NFS4ERR_EXPIRED
which contains a fix for the NFS4ERR_EXPIRED handling.

This patch however fixes the issue with implicit lease renewal by not
setting the cl_last_renewal to now,
unless there is no lease set yet.

This was tested with 5.5.0-rc2 and the provided patch is applied on top of
the 5.5.0-rc2 as well.


btw: Recent ONTAP versions return NFS4ERR_STALE_CLIENTID which is handled
correctly - Linux client will try to renew its lease and if successful it
will retry open().
     


Best regards,
 Robert Milkowski



From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 877E0C2D0BF
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:41:16 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id 5E677206A5
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:41:16 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ngqFTy3o"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1729346AbfLPSlP (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:41:15 -0500
Received: from mail-wr1-f45.google.com ([209.85.221.45]:33232 "EHLO
        mail-wr1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1728940AbfLPSlN (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:41:13 -0500
Received: by mail-wr1-f45.google.com with SMTP id b6so8590019wrq.0;
        Mon, 16 Dec 2019 10:41:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=dmiMgoD75AAcjw9CAZdw1UHn0tTsdKG95qJoZRe609s=;
        b=ngqFTy3olA305iYX6EZqcLN+BQjyz2wKMWgz3dJ2m8O/tyEtLn7SOCWPza8nJMh4zn
         XveTtlWQA+GDN57VINSxnK2ca3s7OUIEa0r8qTD7fnVOOikzEaPTXnwHi8asYPJXPlwx
         KwmYlZJ2lEw3bCsDVw+VtgH/71J5IQsVxSbjs0AemXIb6gNljIc36geRdKxfvDgfIgWu
         1fEeMk2d/t2o7dHcpNxjDppkb8lFfnIhXrtDnlTAzOfyHUW9sfFNWuZlKkNnFeou+ui1
         IR2EZRSCtt7uQTCOD50N9UNiRa1LTn7jFw2VP+FjoK9eDUAllIUVlJgn4RArjydl3Gc+
         1vYA==
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:references:in-reply-to:subject:date
         :message-id:mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=dmiMgoD75AAcjw9CAZdw1UHn0tTsdKG95qJoZRe609s=;
        b=iNLadC+dy8zPHAOeyj6RCfOUqSMDDDe+VzDGX3fSvnvh2C5VQ4XLlumjQZ4hU7eNe3
         ps/v85WodOjzZi6SkMFDxWlWLid4dI1sodBhkRZjUTFK3Y51/W0U+URpeGz9nukdC7Nu
         XCjTqs9A4t4gLsfR5uXYQS3uCrhgN6MWobvsbrD3qdwiV6wecvfhN4YY/Mm9VuKfaYxq
         Zg9zK31z4kqTSs2OpnBsYOVrLWDWgRBrd0eQ95ZMut3xlYINEUsdhu7HrmS1sQZSEZVz
         tuO2liB85RHJsHMbEuX2P3Qx691SC7DDVArPxzVsdNt/KguVulJVbQxJvuoa6Y9wYZdN
         j+kA==
X-Gm-Message-State: APjAAAWGvd2S1SwYbtVXnGuoSkip8qu/rwMcNeZgipSVlSf+yEaE5yOf
        bi+7qtTLNnNvS9CJs/yWGLE=
X-Google-Smtp-Source: APXvYqyKkMN/qW4xYNq8UMawoOmvbRZkuOZ+cFL6xDfsqUXPsmPt1FpvM7lRXAbCbYvtCCNI/KiKTA==
X-Received: by 2002:a5d:5708:: with SMTP id a8mr33619339wrv.79.1576521671684;
        Mon, 16 Dec 2019 10:41:11 -0800 (PST)
Received: from WINDOWSSS5SP16 (cpc96954-walt26-2-0-cust383.13-2.cable.virginm.net. [82.31.89.128])
        by smtp.gmail.com with ESMTPSA id z83sm293566wmg.2.2019.12.16.10.41.10
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 16 Dec 2019 10:41:11 -0800 (PST)
From:   "Robert Milkowski" <rmilkowski@gmail.com>
To:     <linux-nfs@vger.kernel.org>
Cc:     "'Trond Myklebust'" <trond.myklebust@hammerspace.com>,
        "'Anna Schumaker'" <anna.schumaker@netapp.com>,
        <linux-kernel@vger.kernel.org>, <linux-nfs@vger.kernel.org>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com> <05cd01d5b43f$b7d88f60$2789ae20$@gmail.com>
In-Reply-To: <05cd01d5b43f$b7d88f60$2789ae20$@gmail.com>
Subject: RE: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
Date:   Mon, 16 Dec 2019 18:41:10 -0000
Message-ID: <05dd01d5b440$63421740$29c645c0$@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: AQIkbnQjyymuSgNjdVHy4DQRhOG+0gKmN4ENpwpw5eA=
Content-Language: en-gb
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org


>btw: Recent ONTAP versions return NFS4ERR_STALE_CLIENTID which is handled
correctly - Linux client will try to renew its lease and if successful it
will retry open().
 
One more comment here, although the issue won't manifest to applications
with NetApp fileservers in this case, it is still wrong for the client to
end up in such a state.
Also, you will need to wait longer (keep unmounting/mounting) with NetApp
filers as they seem to have implemented courtesy locks/delayed lease
expiration as per the RFC.
This means to reproduce the issue against NetApp you need to wait at least
2x grace period + 1 minute).


    
Best regards,
 Robert Milkowski




From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 2352FC43603
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:43:51 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id E51862082E
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:43:50 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rEz8EjCX"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1729180AbfLPSnt (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:43:49 -0500
Received: from mail-wm1-f51.google.com ([209.85.128.51]:36273 "EHLO
        mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1728015AbfLPSnp (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:43:45 -0500
Received: by mail-wm1-f51.google.com with SMTP id p17so415951wma.1;
        Mon, 16 Dec 2019 10:43:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=elMrRXgYjqqcDW9HgDULCgtrVHwGmK3nW7zi1Cteouw=;
        b=rEz8EjCX4+egOtQuj+esnwBDzNYFQw+/f2eFCoub7+q7H5XKLmpMhRffMCUFPtcGyh
         kA6TbkuepdeYJ2tNCzbfX2HuoZ6yhaNMElABBrkjuEx8zwjaG6H7YovqgQbIqeexR76Q
         +3A2bmDpHT5oDpFli85QJ0okyEkWu7vivrfBVrkIeAX9UhrCKoSmMCQxONqn5lO49gM3
         Se+S+NwphaS459qLNDRBAat1LxVnuQI66Uc49O+Sy/0PuIrc+cwFeco413PAUdg2iSHf
         GV3yJBdg6Ig2rmS+++de2xoDJBxyzMp4yrjjxLLaeBQVA4uajlnuWHC1UnogC7Xv4CXa
         LreQ==
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:references:in-reply-to:subject:date
         :message-id:mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=elMrRXgYjqqcDW9HgDULCgtrVHwGmK3nW7zi1Cteouw=;
        b=BPbpv5w8yy7uBz4+FO3cbJ4bDQjpZtRJl2184zbFeXe5c+YcNLB/nvw34p9YggnURh
         mWMYZQb8vyrc8NkH7f2EAF8zVo/tn4HnOgoweOdPIGSvbSBkxmyTTOX9UNvlS/z8yFPW
         5cc7w4jtpZRUb2SFOTkxxQhLDkKPPILBwa+Ws2jIARKxJzcq9IktnE/TY4B3TpvdRyDj
         F0Bs5kiF6Szy52t+2vI/22Jc/7L2jpBoYdMoJOFO7ynL9FMziUx+QGhlXyWGpZkW4QC0
         ZGOpwPRn9k0iKnI1nTp/hWE5GjZPntyW8qMqbW5ugBMnMG9gXbOn1TOx6aa+5bV7vA3Y
         XFug==
X-Gm-Message-State: APjAAAW2zhFd/9Ak821Nd/srrXLORhlkeeIHK0Iek1MaENuzqyqKRQM8
        XsP/f2nwqUZiAP/FkYdjkXsecZL5XcI=
X-Google-Smtp-Source: APXvYqxXXptPKJYglwJxC4E3WNy9hSVCs5w+F2lnKPKfu6JxOvlfpmv4Ehi1E1v8b0PNi0GWmlX3Pg==
X-Received: by 2002:a1c:7c11:: with SMTP id x17mr461348wmc.168.1576521823232;
        Mon, 16 Dec 2019 10:43:43 -0800 (PST)
Received: from WINDOWSSS5SP16 (cpc96954-walt26-2-0-cust383.13-2.cable.virginm.net. [82.31.89.128])
        by smtp.gmail.com with ESMTPSA id u8sm285198wmm.15.2019.12.16.10.43.42
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 16 Dec 2019 10:43:42 -0800 (PST)
From:   "Robert Milkowski" <rmilkowski@gmail.com>
To:     "'Trond Myklebust'" <trondmy@hammerspace.com>,
        <linux-nfs@vger.kernel.org>
Cc:     <anna.schumaker@netapp.com>, <linux-kernel@vger.kernel.org>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com> <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
In-Reply-To: <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
Subject: RE: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
Date:   Mon, 16 Dec 2019 18:43:42 -0000
Message-ID: <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
        charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQIkbnQjyymuSgNjdVHy4DQRhOG+0gINBlEqpw88FDA=
Content-Language: en-gb
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org



> From: Trond Myklebust <trondmy@hammerspace.com>=20
...
>NACK. The above argument only applies to legacy minor version 0 setups, =
and does not apply to NFSv4.1 or newer.

Correct. However many sites still use v4.0.


Best regards,
 Robert Milkowski


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,
	SPF_PASS autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id C80E4C2D0C3
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:58:23 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id A08522067C
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:58:23 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (1024-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b="DzkTH8w3"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726742AbfLPS6W (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:58:22 -0500
Received: from mail-dm6nam12on2123.outbound.protection.outlook.com ([40.107.243.123]:15584
        "EHLO NAM12-DM6-obe.outbound.protection.outlook.com"
        rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP
        id S1726390AbfLPS6W (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:58:22 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=PxD1FLZqUjVHICJg9jZDAnnQH2k8JdB4PIo0IUnFBNF15T6c9vnZVbXiht+5yOK9g1NxVn6eZBkTSP7VZqOu0AMgwQcCJ91OaJILHfx0o/SAo0GCVjdk+Sd3KCf8LrWfgHZvd2S8LWB2tVBHVe6gHS5jftKCtQvL5c02rSb5nuDLgKQPQucgjLHuxI6eexdzkQlwOuFZw80oT5eq6fBu04eeuMc1Hz85F7gqo1WY+kMQwDizSkRjyZiUkwHtdVDTfKMaR9e+MYDCaBCWy9F/78or74424kG9IYU7kHDdZ1zvGGXAgqyZsnAYEFodik2mKHMiz5yHryYGE5/HvpehQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9EJ5bwbuzPzNBR8xkJ1Mh2d+VX76z8Elc4YlDKRu/2M=;
 b=Cx6sqaRlGl7+UgrzzoqAOWrvX5470xxlwtLQ6GtIaEe00fGyJ+MeUJO3cIHOyx0N6yd38mqMMfLjMijBbGnsBsf37KRjk3OVIauQlT/ZzAIYWjdNfTG7ewJbnIEBpJP9Q4/lXVL+ELV6xDtDI+zg3CciAMY9LEzygOPWEFrGG7xJ4yqKlIR/7FckTT0NXeJKEISsQKqWTh0KSw7wxEd/VImW5TwYEBJUZSWaGfRNOvugZVeW8Sb8aXMVq6T59H4NP5AFZ2FvViK906hdTqNHGj/oyx3QSv7KggRbp3wTaCwxDa3OFTZOO4KjbxOemMGmAcbLHM+9sDZQyx4eOnHdFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=hammerspace.com; dmarc=pass action=none
 header.from=hammerspace.com; dkim=pass header.d=hammerspace.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9EJ5bwbuzPzNBR8xkJ1Mh2d+VX76z8Elc4YlDKRu/2M=;
 b=DzkTH8w3Ood2Te9RlGSVlpKSmL+0sg8o17U3yAbO2hUqbG7nA4ue+xdi8dUeQjZxwfdP8g+RS8aEaOfuo75W9JakoE8/nb4Sgh80RbBT8P+AK/kaT77nLQK2iladQbxHsC6WIKiGtYZ/rHUGLZyrVvvEGftxQ7db9go/WB9497w=
Received: from DM5PR1301MB2108.namprd13.prod.outlook.com (10.174.186.34) by
 DM5PR1301MB1900.namprd13.prod.outlook.com (10.174.184.146) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2559.12; Mon, 16 Dec 2019 18:58:19 +0000
Received: from DM5PR1301MB2108.namprd13.prod.outlook.com
 ([fe80::2d23:b456:d67:f230]) by DM5PR1301MB2108.namprd13.prod.outlook.com
 ([fe80::2d23:b456:d67:f230%6]) with mapi id 15.20.2559.012; Mon, 16 Dec 2019
 18:58:19 +0000
From:   Trond Myklebust <trondmy@hammerspace.com>
To:     "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
        "rmilkowski@gmail.com" <rmilkowski@gmail.com>
CC:     "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
        "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease
 renewals
Thread-Topic: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease
 renewals
Thread-Index: AdW0MytZJzbanD9yTZ+e0zLvCdtxJAACuc6AAACqnwAAAIJigA==
Date:   Mon, 16 Dec 2019 18:58:19 +0000
Message-ID: <2d94fa3e9632c638f9e47999fd8e26cb3b34b4dc.camel@hammerspace.com>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
         <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
         <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com>
In-Reply-To: <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=trondmy@hammerspace.com; 
x-originating-ip: [68.40.189.247]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: db03ab79-4836-451c-502a-08d78259ea63
x-ms-traffictypediagnostic: DM5PR1301MB1900:
x-microsoft-antispam-prvs: <DM5PR1301MB190077CC7EDD93DDF01B89D5B8510@DM5PR1301MB1900.namprd13.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8273;
x-forefront-prvs: 02530BD3AA
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(136003)(376002)(346002)(39840400004)(396003)(199004)(189003)(64756008)(110136005)(54906003)(66556008)(66446008)(186003)(316002)(86362001)(8936002)(81166006)(8676002)(4001150100001)(81156014)(4326008)(6506007)(6486002)(26005)(66946007)(5660300002)(2906002)(66476007)(36756003)(6512007)(508600001)(4744005)(2616005)(71200400001)(76116006)(91956017);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR1301MB1900;H:DM5PR1301MB2108.namprd13.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1;
received-spf: None (protection.outlook.com: hammerspace.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 9p45gKNF0TDreVVp7TGVHYJ0BfG7KbJ8gh/3DhAzO/nPXXPOM8QkY4a9HHxP7rekftW8c6E8lbzcpHGGnlptCsRoMFknzSYAYeFZDYF4M5xQj0XxAru6a/DvKrxg5y6RQPtMk/ah74TEUqq67d5+Z33T3QyNRtxqmv0PxTJWHJTLtZNoC0vy5pdlrGgJ3VIwX7cwrCq/C0n9UGYAuQ3NFnzBwZQJURSVQNWC0SYXvPWqMzqvGbGTEgI9pPRUMf+TecmA6qwa6GHU0CGlre1tnsAXsMRYN1wRPGH4bOAYuRWhQppkY2M5aWYqd/ZjQoViCpz8onYmSLfkgNjOPDg4vOs17gU4dg12W4SXeJbf2P6l/FER5AVQTx2M+OXOaydHkX2XT9kI5m7X/i0uX5NkqiC7NGpcagPR9my4Q80wLlBhx87FGJ8lVbG6wcpRe7E4
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-ID: <F2C7A3AC455ACB4AA9029C65D9099BF3@namprd13.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: hammerspace.com
X-MS-Exchange-CrossTenant-Network-Message-Id: db03ab79-4836-451c-502a-08d78259ea63
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 18:58:19.1182
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 0d4fed5c-3a70-46fe-9430-ece41741f59e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ekqefYbafsGkIg/thB2pDGRYODXTYQnydAtblhHOuwT/k3JY86NaSjgdH9jhe0A6hCTtVIGVq2fZlJ/faNActw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1301MB1900
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

LU9uIE1vbiwgMjAxOS0xMi0xNiBhdCAxODo0MyArMDAwMCwgUm9iZXJ0IE1pbGtvd3NraSB3cm90
ZToNCj4gPiBGcm9tOiBUcm9uZCBNeWtsZWJ1c3QgPHRyb25kbXlAaGFtbWVyc3BhY2UuY29tPiAN
Cj4gLi4uDQo+ID4gTkFDSy4gVGhlIGFib3ZlIGFyZ3VtZW50IG9ubHkgYXBwbGllcyB0byBsZWdh
Y3kgbWlub3IgdmVyc2lvbiAwDQo+ID4gc2V0dXBzLCBhbmQgZG9lcyBub3QgYXBwbHkgdG8gTkZT
djQuMSBvciBuZXdlci4NCj4gDQo+IENvcnJlY3QuIEhvd2V2ZXIgbWFueSBzaXRlcyBzdGlsbCB1
c2UgdjQuMC4NCj4gDQoNClRoYXQncyBub3QgYSBnb29kIHJlYXNvbiB0byBicmVhayBjb2RlIHRo
YXQgd29ya3MganVzdCBmaW5lIGZvcg0KTkZTdjQuMS4NCg0KSXQgd291bGQgYmUgYmV0dGVyIHRv
IG1vdmUgdGhlIGluaXRpYWxpc2F0aW9uIG9mIGNscC0+Y2xfbGFzdF9yZW5ld2FsDQppbnRvIG5m
czRfaW5pdF9jbGllbnRpZCgpIGFuZCBuZnM0MV9pbml0X2NsaWVudGlkKCkgKGFmdGVyIHRoZSBj
YWxscyB0bw0KbmZzNF9wcm9jX3NldGNsaWVudGlkX2NvbmZpcm0oKSBhbmQgbmZzNF9wcm9jX2Ny
ZWF0ZV9zZXNzaW9uKCkNCnJlc3BlY3RpdmVseSkuDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpM
aW51eCBORlMgY2xpZW50IG1haW50YWluZXIsIEhhbW1lcnNwYWNlDQp0cm9uZC5teWtsZWJ1c3RA
aGFtbWVyc3BhY2UuY29tDQoNCg0K

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=TLrx=2G=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
	SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no
	version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id F1791C43603
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:58:52 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id C49ED2067C
	for <linux-kernel@archiver.kernel.org>; Mon, 16 Dec 2019 18:58:52 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kBQyrl2j"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726825AbfLPS6v (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Mon, 16 Dec 2019 13:58:51 -0500
Received: from userp2120.oracle.com ([156.151.31.85]:33972 "EHLO
        userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1726390AbfLPS6v (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Mon, 16 Dec 2019 13:58:51 -0500
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
        by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBGIsFl9100289;
        Mon, 16 Dec 2019 18:58:45 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type :
 mime-version : subject : from : in-reply-to : date : cc :
 content-transfer-encoding : message-id : references : to;
 s=corp-2019-08-05; bh=NhpTFUpVaSqwOFai7Eue2o+ccU1k68md94uDlBIiv3Q=;
 b=kBQyrl2j5rDFKezPL0afJWZQdA5D6h/PDueWIOAdzRBsu6nH1C+V//2iWhxWsJGIE45q
 yMG2WX1nPuXO5hH3j0X/+x9fCk7iWNoPuCROfuNlcIpzUPpHH8lHOC9l9p7yOd2hPIHx
 Htvz+urgbLvRM/zeVqz+DhNY8qF+mFXVtb+8zCMU9UqoiZkfh6BNWNbuc+45tg/lM2KF
 2vSx50D4DISTRpX9pk2GPBz3QOqFjHOoQmL/gX1gto8+Nz7TdariMF/gYgAbBLw2a0wd
 uhu4WYXWg+d8akf2qYkrYGM2wYGC90F9DTB+6z3d+CFVXVmDYU7CfD1eoUmmV5NifuEx Sw== 
Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70])
        by userp2120.oracle.com with ESMTP id 2wvrcr1gmb-1
        (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
        Mon, 16 Dec 2019 18:58:45 +0000
Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1])
        by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBGIsBKJ114480;
        Mon, 16 Dec 2019 18:58:44 GMT
Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])
        by aserp3020.oracle.com with ESMTP id 2ww98srks2-1
        (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
        Mon, 16 Dec 2019 18:58:44 +0000
Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23])
        by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xBGIwg2u022332;
        Mon, 16 Dec 2019 18:58:43 GMT
Received: from anon-dhcp-152.1015granger.net (/68.61.232.219)
        by default (Oracle Beehive Gateway v4.0)
        with ESMTP ; Mon, 16 Dec 2019 10:58:42 -0800
Content-Type: text/plain;
        charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Subject: Re: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease
 renewals
From:   Chuck Lever <chuck.lever@oracle.com>
In-Reply-To: <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com>
Date:   Mon, 16 Dec 2019 13:58:41 -0500
Cc:     Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
        Trond Myklebust <trondmy@hammerspace.com>,
        Anna Schumaker <anna.schumaker@netapp.com>,
        Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <AF0DEDD8-9930-4E90-B49F-CBC8C759831D@oracle.com>
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com>
 <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
 <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com>
To:     Robert Milkowski <rmilkowski@gmail.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9473 signatures=668685
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1911140001 definitions=main-1912160160
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9473 signatures=668685
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0
 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011
 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001
 definitions=main-1912160160
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org



> On Dec 16, 2019, at 1:43 PM, Robert Milkowski <rmilkowski@gmail.com> =
wrote:
>=20
>=20
>=20
>> From: Trond Myklebust <trondmy@hammerspace.com>=20
> ...
>> NACK. The above argument only applies to legacy minor version 0 =
setups, and does not apply to NFSv4.1 or newer.
>=20
> Correct. However many sites still use v4.0.

v4.1 and newer actually do renew the lease with the FSINFO COMPOUND,
since the COMPOUND starts with a SEQUENCE operation.

For v4.0, you can get the equivalent behavior by adding a RENEW to
the end of the FSINFO COMPOUND.


--
Chuck Lever




From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=vnTL=2H=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 0AEF7C2D0CD
	for <linux-kernel@archiver.kernel.org>; Tue, 17 Dec 2019 18:12:30 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id D65E92067C
	for <linux-kernel@archiver.kernel.org>; Tue, 17 Dec 2019 18:12:29 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KwFnS9QS"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1727939AbfLQSM2 (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Tue, 17 Dec 2019 13:12:28 -0500
Received: from mail-qk1-f194.google.com ([209.85.222.194]:34230 "EHLO
        mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1727360AbfLQSM2 (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Tue, 17 Dec 2019 13:12:28 -0500
Received: by mail-qk1-f194.google.com with SMTP id j9so8086008qkk.1;
        Tue, 17 Dec 2019 10:12:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=94WcDwyswmJ+xZ6oQZ+EBBfqZNKwF38tRDgKQsxSOP8=;
        b=KwFnS9QSEv9LyokZomttACcmx6y4KqxsdPNANWGey9uKIUNfsof9hFIGFTRC9Gfy+Y
         cnd8Dm5yrC1ntADbk8l8Z+LcB91W41sUUYz3r53dm4k/6xhpA66WJCQkkeygyqvnD4q1
         4n81ah1szCmtBZTRCLlwoBa1IkQzwX2yUNG3kbpA1/XxBcbKcM+xNYtnLYrzg3rkIscT
         PpZEEun1Fh4hk/EBlJ0FlN+Uch/oW6M72jt+S+ChnUkk0HEiKgDDTY29cDaZX/T8gE/g
         JW2TF8xQwUEW5KUV6knwLB1W7PhY/vSllRQa5FVMEQ0yjvXqWoMfefhB7D3S9DTPD5Ba
         NLEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=94WcDwyswmJ+xZ6oQZ+EBBfqZNKwF38tRDgKQsxSOP8=;
        b=ALg86n9as8j0r+xAgJ0KBCjNJ6Vijpw1adjVJbpT1OWXKynjImkWZuyG7CsGWn7+D6
         NvUDYGp21jAYe7YQAsRS0cl4i/8XfmGvWhDHH4Aqt9fLmEZrbTMVZdAqm02YyfmC3cxQ
         fPUoC2wddAmck4y2zv0vPcxT7qEtCsio1eyI3uyIYIqEvqE5JV2o8YF9UTIf2sMgt7z8
         5e+58AqceIdlOm0aixLDIoncymDG5mQixRsDoGoEpz2fR2tsNz4e0xuTSvIutGoMFYb5
         KBidYpIfkUZhokTjhrlwTajwXaZhpr/qI6miaDbE6MF6JKVjuVt0FLkJ7GzM16b60MYK
         a8bQ==
X-Gm-Message-State: APjAAAUuay48qvJTL1GLmOKiglKFR7Pi1YHimARb0hzusM/A8pJXcj+K
        Ga0Q6ifG+W2syIKyVw+sHEnHQKZxy8yJqSSWx4A=
X-Google-Smtp-Source: APXvYqxokIyQB2bMqD8wFppcI0RegO2Y2reD8DeoM3KJDcVm8CV1EP6T+DJcgKPlB40YGBxIkiBPJwxdgxPR5QmEflQ=
X-Received: by 2002:a05:620a:1401:: with SMTP id d1mr5798512qkj.79.1576606347113;
 Tue, 17 Dec 2019 10:12:27 -0800 (PST)
MIME-Version: 1.0
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com> <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
 <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com> <2d94fa3e9632c638f9e47999fd8e26cb3b34b4dc.camel@hammerspace.com>
In-Reply-To: <2d94fa3e9632c638f9e47999fd8e26cb3b34b4dc.camel@hammerspace.com>
From:   Robert Milkowski <rmilkowski@gmail.com>
Date:   Tue, 17 Dec 2019 18:12:16 +0000
Message-ID: <CALbTx=H_49MroKwuwyThirwtiJE5686cyCZwKth-yVSRx0srug@mail.gmail.com>
Subject: Re: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
To:     Trond Myklebust <trondmy@hammerspace.com>
Cc:     "chuck.lever@oracle.com" <chuck.lever@oracle.com>,
        "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
        "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
        "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Content-Type: text/plain; charset="UTF-8"
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On Mon, 16 Dec 2019 at 18:58, Trond Myklebust <trondmy@hammerspace.com> wrote:
>
> -On Mon, 2019-12-16 at 18:43 +0000, Robert Milkowski wrote:
> > > From: Trond Myklebust <trondmy@hammerspace.com>
> > ...
> > > NACK. The above argument only applies to legacy minor version 0
> > > setups, and does not apply to NFSv4.1 or newer.
> >
> > Correct. However many sites still use v4.0.
> >
>
> That's not a good reason to break code that works just fine for
> NFSv4.1.
>

Of course not, that's not what I meant and I misunderstood your nack too.

> It would be better to move the initialisation of clp->cl_last_renewal
> into nfs4_init_clientid() and nfs41_init_clientid() (after the calls to
> nfs4_proc_setclientid_confirm() and nfs4_proc_create_session()
> respectively).
>

This could be done but this is potentially a separate change, as in
nfs4_do_fsinfo() we still need to
make sure we do not implicitly renew lease for v4.0, so I think the
patch needs to be modified as:

...
+                       /* no implicit lease renewal allowed here for v4.0 */
+                       if (server->nfs_client->cl_minorversion == 0
&& server->nfs_client->cl_last_renewal != 0)
+                               last_renewal =
server->nfs_client->cl_last_renewal;
                        nfs4_set_lease_period(server->nfs_client,
                                        fsinfo->lease_time * HZ,
-                                       now);
+                                       last_renewal);
...

This way it won't affect newer nfs versions (I don't think it affected
them in any bad way, still it was unintended and not correct).
Agree with the above change?

btw: Chuck, thanks for the hint regarding the SEQUENCE op on v4.1+

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0=eolO=2I=vger.kernel.org=linux-kernel-owner@kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
	aws-us-west-2-korg-lkml-1.web.codeaurora.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
	HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.0
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 9A1D6C2D0CD
	for <linux-kernel@archiver.kernel.org>; Wed, 18 Dec 2019 14:48:50 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id 6CBC924650
	for <linux-kernel@archiver.kernel.org>; Wed, 18 Dec 2019 14:48:50 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rCSqdHkH"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1727298AbfLROst (ORCPT
        <rfc822;linux-kernel@archiver.kernel.org>);
        Wed, 18 Dec 2019 09:48:49 -0500
Received: from mail-qv1-f65.google.com ([209.85.219.65]:41145 "EHLO
        mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1726856AbfLROst (ORCPT
        <rfc822;linux-kernel@vger.kernel.org>);
        Wed, 18 Dec 2019 09:48:49 -0500
Received: by mail-qv1-f65.google.com with SMTP id x1so829972qvr.8;
        Wed, 18 Dec 2019 06:48:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=03LZZ1Q88h/Vi7kuW4/G+tMxZypv0uuxA868U5NI5Kg=;
        b=rCSqdHkHdw7MyQM6V2wX4E41GW4G2/vwDR0auAmquMnDYrF6mEkBvcgOCXd6CzirIS
         nevXw2d3ZwNWgS/vRbR65z56h7yfn6oqBPnz2Q9+qeS05WA8y6nNnnSc+CT1klQNHRp7
         3u8v6YHI03PicsQ3UgXl6DHgn8VOldhF8JVNLDXHwQ4Z0Lj8W5hKj/w60g/jBA+Thgwj
         0+dVqmYcBodrOPSc2Way2rzaDjH7P8VG6udeYL01JNOC1wxCjtcUHwfCDBRZk1Bzi2gG
         SZHrg8FmdrWwaug1s28phPtgapdy3eSLtOMgGTCr7SeUrtwgRroMWSXg0HPgjXi356S/
         cI3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=03LZZ1Q88h/Vi7kuW4/G+tMxZypv0uuxA868U5NI5Kg=;
        b=FRwCZMW9J1mtB89PzntwwCbGVeCYn4K0Pq6G3e9C4GtRaVTENlaUzwQcFK37Qg4xxI
         Pia+SHxuApCz2cQn/ja3kTjQ5eDOYt4Dn2CeHyCQ9N34sSLsTX0v4rhM7PzggdxujLAw
         qiVuuog/hA1QoZkUIsuh+F+eMLok8PiKRLWWo4jvb3UzsVqptKQ8ueZzTQMT0VFeAqNg
         XMLmaGm1Dc0zoAG/dQQ/rkqLUvug2SQTsQDnlNIyj5rijvWdTgt6bt5VeYA/p/1+KjgL
         zkWNpG5fGtJ7WZfSo/w+C5DMbveX84UWN1zcDE+7Xh/d1BuQUwhbvTv4OV+8QHvJYxrs
         03yQ==
X-Gm-Message-State: APjAAAVtkFMMq79KEVvfF9t0hQunAGd3BukJOQe2bYRwn9lzflazdJOF
        6YG/3wITXvVxqrOo7X6lzCCsKu60OCtoMrkFGIwTUw7YFEg=
X-Google-Smtp-Source: APXvYqyedeACk3XMykTt78aYIgOyHUys2yyKMAdabZPSCX7yCyBFKjkFUrlGmDMEkRU5DIovnwOh4ZgaqOg9FwEf3jI=
X-Received: by 2002:ad4:46e4:: with SMTP id h4mr2690617qvw.181.1576680528099;
 Wed, 18 Dec 2019 06:48:48 -0800 (PST)
MIME-Version: 1.0
References: <056501d5b437$91f1c6c0$b5d55440$@gmail.com> <dea30ea3f0fc31e40b311c4d110c26cf40658dca.camel@hammerspace.com>
 <05ea01d5b440$bd9d58d0$38d80a70$@gmail.com> <2d94fa3e9632c638f9e47999fd8e26cb3b34b4dc.camel@hammerspace.com>
 <CALbTx=H_49MroKwuwyThirwtiJE5686cyCZwKth-yVSRx0srug@mail.gmail.com>
In-Reply-To: <CALbTx=H_49MroKwuwyThirwtiJE5686cyCZwKth-yVSRx0srug@mail.gmail.com>
From:   Robert Milkowski <rmilkowski@gmail.com>
Date:   Wed, 18 Dec 2019 14:48:37 +0000
Message-ID: <CALbTx=HUA6PdBufwmyYaN3J1pETUzRk=5HM7BKCDv8+PM2Qm9Q@mail.gmail.com>
Subject: Re: [PATCH] NFSv4: nfs4_do_fsinfo() should not do implicit lease renewals
To:     Trond Myklebust <trondmy@hammerspace.com>
Cc:     "chuck.lever@oracle.com" <chuck.lever@oracle.com>,
        "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
        "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
        "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Content-Type: text/plain; charset="UTF-8"
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On Tue, 17 Dec 2019 at 18:12, Robert Milkowski <rmilkowski@gmail.com> wrote:
>
> On Mon, 16 Dec 2019 at 18:58, Trond Myklebust <trondmy@hammerspace.com> wrote:
> >
> > It would be better to move the initialisation of clp->cl_last_renewal
> > into nfs4_init_clientid() and nfs41_init_clientid() (after the calls to
> > nfs4_proc_setclientid_confirm() and nfs4_proc_create_session()
> > respectively).
> >
>
> This could be done but this is potentially a separate change, as in
> nfs4_do_fsinfo() we still need to
> make sure we do not implicitly renew lease for v4.0, so I think the
> patch needs to be modified as:

I took a look at the client initialization and the
nfs4_init_clientid() already calls nfs4_setup_state_renewal(),
which in turn calls nfs4_proc_get_lease_time(), however that might
return with an error in which case it won't set the cl_last_renewal,
the code is:

static int nfs4_setup_state_renewal(struct nfs_client *clp)
...
        status = nfs4_proc_get_lease_time(clp, &fsinfo);
        if (status == 0) {
                nfs4_set_lease_period(clp, fsinfo.lease_time * HZ, now);
...

In my environment with nfsv4+krb the nfs4_proc_get_lease_time()
returns with -10016 (NFS4ERR_WRONGSEC) during initial mount (which
after a quick scan of the rfc seems that might be ok initially).
Also for v4.1 do_renew_lease() is called by nfs41_sequence_process()
multiple times during mount before we even reach nfs4_do_fsinfo() so
for 4.1+ it never gets cl_last_renewal==0, at least not under this
circumstances.

There might be other cases where nfs4_do_fsinfo() will get
clp->cl_last_renewal=0 for nfsv4.0, and since the nfs4_do_fsinfo()
already initializes the cl_last_renewal record, plus as Chuck pointed
out in case of v4.1+
it is expected to implicitly renew the lease anyway, I would rather
focus on fixing only the reported issue here for now, which is the
incorrect implicit renewal in fsinfo for v4.0, and leave improvements
to client initialization for another day.

I will send an updated patch shortly which doesn't impact v4.1+.

