Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3737361ybl; Mon, 27 Jan 2020 09:26:52 -0800 (PST) X-Google-Smtp-Source: APXvYqzYzO65Vwqqiexz7gKPGcfcvntzPGrtikQ0fEwI3juqhOagIwSEwizq5uCw0+zROg/pa1bv X-Received: by 2002:a9d:730e:: with SMTP id e14mr12640679otk.62.1580146012449; Mon, 27 Jan 2020 09:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580146012; cv=none; d=google.com; s=arc-20160816; b=iFE5GucXVPhqgBmoXXMyx1SrFQ46AWpwHOkfl/omeh34PFm0QUg9kJF2H6/sV5kc/F mZ+/aaBl0YXSCktC/YMjXneJ/PqdJ170Ytty5E+bHHCKZlfzCEutsw9uHm3OU5orsUkT lO5+HLdPUhNdCE5gbPeN1EIabYzmXEUUikRY+HwbjS0u/wahM3fcrUeR7+VoVuLOa8K9 tshoy49iZxqIm2Vv8a6ONcCplt5WXW3rlEelqF4y6F1rawvp/QBqte4ZRiW/kwK94hEb AXf0PHpUc6DKi1CFh+VBE8Qk7IZWrwUumHKH9PNs80aEtIg7jhYtNH0mvnfmHrxms5vk BfNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kf2FDJGFABsa8dMfNJh+lTWVV7yYf0R3wgfeAqnShMc=; b=uggDy+SwFdvpxaxnW30wFDHlEiqxUonp3UlmPA3C6TJG8xZmLHLdN1VmoGtvuI0NuZ n5icTECIuqrIjObWFtTrPZkIw9kV6H4T1cdxwruCPOPwuk3saH7vUJJIQSYx7y1Tw5bD /QRpbYOlu+a0ONHZfkQTdqwfFC4GFmxkdF6fx4eMi0WHghxw45U2SHW7auuhVgYMUUd0 a9YdY4J4yxAjGV+HV/REzrbdjhE6UvB6JzHrkwHEndLQ1VAJ7dX4+ALrtQ8WizVluBy/ NrE05RCT9ld9CKtwlzgLqRlhtiFO/4DH4o4Lg4tUzV3DRqpj+CD0FIDKbAw+zdWP8OmJ TBrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K5cRyYfA; 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 i12si7608187otk.215.2020.01.27.09.26.30; Mon, 27 Jan 2020 09:26:52 -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=K5cRyYfA; 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 S1725845AbgA0R03 (ORCPT + 99 others); Mon, 27 Jan 2020 12:26:29 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:41138 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgA0R03 (ORCPT ); Mon, 27 Jan 2020 12:26:29 -0500 Received: by mail-qk1-f177.google.com with SMTP id s187so10396159qke.8; Mon, 27 Jan 2020 09:26:29 -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=kf2FDJGFABsa8dMfNJh+lTWVV7yYf0R3wgfeAqnShMc=; b=K5cRyYfAGJg49+k4NPcUlUtuPQo2ckeAhTzgYeX+0cOluS/SHNz7C++gaNn06jOaC7 dh2q8dcz16E2AB7zc+/cntD0ETNl8qxZZWF4YZqnlgUU+VySOZ6R5yp6lXLQmOoMWM5L /n4cNa4DQAMcqbFzjtr1EigbhqHtWUwI34hLInhTIu3v1zjVFvQKIisS8B22c8Lxd5A8 ubgzLIl1HLm6alyMWpdqJKTK40k5ZxUvFJfdGVhKHNeLdZYSRt1UbnLjzGYXsYFEDe19 H80gYbhCRYdhD+KEwEUVdb0Qu84sV6GXmnl0hGg6vQ9CAN2piOebNgSGRgsvs50mAksU QITQ== 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=kf2FDJGFABsa8dMfNJh+lTWVV7yYf0R3wgfeAqnShMc=; b=DYVtDXPTg29QEW1gFwTCoBRw/AxeiP4aAR94Sf7bbOBf9eMVlWXCiWQ126TRtNLy5K 2d7wIWCjfSmI2RQzBWRDP0OUUtXw2nJVZxNaiiQ1CHKSfL5FMgT7iBZnOeUMczrLQ5op pVN4XGywpjpGCIxPzW/E2xtmYwI7e8jY9v862bKdVhCLuta1ysuzojFYNTAd3qRs+C2u 8c+4vVf3xGPAUFXjY4WLGHEU8BkVrzPifD+Drpk8EfObg8Fw2u75EhksYlORP0WyppmF MdM1r6ignayWZ72/ziCx34AJMaF8Itut0Gdi7a9kfii0Zjy05hAgGnMPPIu3t8yRmC1s DhYQ== X-Gm-Message-State: APjAAAUg0CO5mZg74UovlEOSaW1fZ43SGW1vqZX0ORH9ayg9Z35V6M+u 1kvQqGujyBBxzkqLN5ci3iGgt/DNZcdINjxw1+Y= X-Received: by 2002:a37:4047:: with SMTP id n68mr17831482qka.258.1580145988471; Mon, 27 Jan 2020 09:26:28 -0800 (PST) MIME-Version: 1.0 References: <025801d5bf24$aa242100$fe6c6300$@gmail.com> <084f01d5cfba$bc5c4d10$3514e730$@gmail.com> <49e7b99bd1451a0dbb301915f655c73b3d9354df.camel@netapp.com> <197269d91db31284dce51b831bfbe2231ac870d4.camel@hammerspace.com> In-Reply-To: <197269d91db31284dce51b831bfbe2231ac870d4.camel@hammerspace.com> From: Robert Milkowski Date: Mon, 27 Jan 2020 17:26:16 +0000 Message-ID: Subject: Re: [PATCH v3] NFSv4.0: nfs4_do_fsinfo() should not do implicit lease renewals To: Trond Myklebust Cc: "linux-nfs@vger.kernel.org" , "Anna.Schumaker@netapp.com" , "linux-kernel@vger.kernel.org" , "chuck.lever@oracle.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > > > > > All that needs to be done here is to move the setting of clp- > > > > cl_last_renewal _out_ of nfs4_set_lease_period(), and just have > > > nfs4_proc_setclientid_confirm() and nfs4_update_session() call > > > do_renew_lease(). > > > > > > > This would also require nfs4_setup_state_renewal() to call > > do_renew_lease() I think - at least it currently calls > > nfs4_set_lease_period(). > > This is the mechanism we're replacing. There is no need for a call to > do_renew_lease() in nfs4_setup_state_renewal(). ok > > > Also, iirc fsinfo() not setting cl_last_renewal leads to > > cl_last_renewal initialization issues under some circumstances. > > > > Then the RFC 7530 in section 16.34.5 states: > > "SETCLIENTID_CONFIRM does not establish or renew a lease.", so > > calling > > do_renew_lease() from nfs4_setclientid_confirm() doesn't seem to be > > ok. > > So just move the do_renew_lease() to nfs4_proc_setclientid(). The > successful combination SETCLIENTID+SETCLIENTID_CONFIRM definitely > _does_ establish a lease. > ok > > I'm not sure if is is valid to do implicit lease renewal in > > nfs4_update_session() either... > > Ditto. Move to the exchange_id call. > ok > > > > Anyway, the patch would be something like (haven't tested it yet): > > ... > > @@ -6146,6 +6143,10 @@ int nfs4_proc_setclientid_confirm(struct > > nfs_client *clp, > > clp->cl_clientid); > > status = rpc_call_sync(clp->cl_rpcclient, &msg, > > RPC_TASK_TIMEOUT | > > RPC_TASK_NO_ROUND_ROBIN); > > + if(status == 0) { > > + unsigned long now = jiffies; > > The variable 'now' needs to be set before the RPC call in order to > avoid overestimating the remaining lease period. > yes, thx. I will get a new patch tested and submitted here this week. -- Robert Milkowski