From patchwork Fri Jun 28 12:36:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Buczek X-Patchwork-Id: 11022335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0F9D76 for ; Fri, 28 Jun 2019 12:37:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B22B5283F9 for ; Fri, 28 Jun 2019 12:37:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A42D628783; Fri, 28 Jun 2019 12:37:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25014283F9 for ; Fri, 28 Jun 2019 12:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbfF1MhB (ORCPT ); Fri, 28 Jun 2019 08:37:01 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:53975 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726578AbfF1MhB (ORCPT ); Fri, 28 Jun 2019 08:37:01 -0400 Received: from theinternet.molgen.mpg.de (theinternet.molgen.mpg.de [141.14.31.7]) by mx.molgen.mpg.de (Postfix) with ESMTP id 01DFB20225BF6; Fri, 28 Jun 2019 14:37:00 +0200 (CEST) From: Donald Buczek To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: Donald Buczek Subject: [PATCH 1/4 RESEND] nfs: Fix copy-and-paste error in debug message Date: Fri, 28 Jun 2019 14:36:37 +0200 Message-Id: <20190628123640.8715-2-buczek@molgen.mpg.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628123640.8715-1-buczek@molgen.mpg.de> References: <20190628123640.8715-1-buczek@molgen.mpg.de> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The debug message of decode_attr_lease_time incorrectly says "file size". Fix it to "lease time". Signed-off-by: Donald Buczek --- fs/nfs/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 602446158bfb..06aaf017e1c6 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -3427,7 +3427,7 @@ static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint *res = be32_to_cpup(p); bitmap[0] &= ~FATTR4_WORD0_LEASE_TIME; } - dprintk("%s: file size=%u\n", __func__, (unsigned int)*res); + dprintk("%s: lease time=%u\n", __func__, (unsigned int)*res); return 0; } From patchwork Fri Jun 28 12:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Buczek X-Patchwork-Id: 11022337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 927EA76 for ; Fri, 28 Jun 2019 12:37:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84579283F9 for ; Fri, 28 Jun 2019 12:37:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78C4E28783; Fri, 28 Jun 2019 12:37:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE6B283F9 for ; Fri, 28 Jun 2019 12:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726702AbfF1MhC (ORCPT ); Fri, 28 Jun 2019 08:37:02 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:41663 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726687AbfF1MhC (ORCPT ); Fri, 28 Jun 2019 08:37:02 -0400 Received: from theinternet.molgen.mpg.de (theinternet.molgen.mpg.de [141.14.31.7]) by mx.molgen.mpg.de (Postfix) with ESMTP id C148320669589; Fri, 28 Jun 2019 14:37:00 +0200 (CEST) From: Donald Buczek To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: Donald Buczek Subject: [PATCH 2/4 RESEND] nfs4: Rename nfs41_setup_state_renewal Date: Fri, 28 Jun 2019 14:36:38 +0200 Message-Id: <20190628123640.8715-3-buczek@molgen.mpg.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628123640.8715-1-buczek@molgen.mpg.de> References: <20190628123640.8715-1-buczek@molgen.mpg.de> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function nfs41_setup_state_renewal is useful to the nfs 4.0 client as well, so rename the function to nfs4_setup_state_renewal. Signed-off-by: Donald Buczek --- fs/nfs/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index e2e3c4f04d3e..778ebfb00d13 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -286,7 +286,7 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) #if defined(CONFIG_NFS_V4_1) -static int nfs41_setup_state_renewal(struct nfs_client *clp) +static int nfs4_setup_state_renewal(struct nfs_client *clp) { int status; struct nfs_fsinfo fsinfo; @@ -313,7 +313,7 @@ static void nfs41_finish_session_reset(struct nfs_client *clp) clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); /* create_session negotiated new slot table */ clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); - nfs41_setup_state_renewal(clp); + nfs4_setup_state_renewal(clp); } int nfs41_init_clientid(struct nfs_client *clp, const struct cred *cred) From patchwork Fri Jun 28 12:36:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Buczek X-Patchwork-Id: 11022341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 173F414E5 for ; Fri, 28 Jun 2019 12:37:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0629E283F9 for ; Fri, 28 Jun 2019 12:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBECB28481; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9947C2878E for ; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726696AbfF1MhD (ORCPT ); Fri, 28 Jun 2019 08:37:03 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:60477 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726578AbfF1MhD (ORCPT ); Fri, 28 Jun 2019 08:37:03 -0400 Received: from theinternet.molgen.mpg.de (theinternet.molgen.mpg.de [141.14.31.7]) by mx.molgen.mpg.de (Postfix) with ESMTP id 5BB3B2066958F; Fri, 28 Jun 2019 14:37:01 +0200 (CEST) From: Donald Buczek To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: Donald Buczek Subject: [PATCH 3/4 RESEND] nfs4: Move nfs4_setup_state_renewal Date: Fri, 28 Jun 2019 14:36:39 +0200 Message-Id: <20190628123640.8715-4-buczek@molgen.mpg.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628123640.8715-1-buczek@molgen.mpg.de> References: <20190628123640.8715-1-buczek@molgen.mpg.de> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function nfs4_setup_state_renewal is to be used by nfs4_init_clientid. Move it further to the top of the source file to include it regardles of CONFIG_NFS_V4_1 and to save a forward declaration. No code changed. Signed-off-by: Donald Buczek --- fs/nfs/nfs4state.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 778ebfb00d13..c2df257f426f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -87,6 +87,27 @@ const nfs4_stateid current_stateid = { static DEFINE_MUTEX(nfs_clid_init_mutex); +static int nfs4_setup_state_renewal(struct nfs_client *clp) +{ + int status; + struct nfs_fsinfo fsinfo; + unsigned long now; + + if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) { + nfs4_schedule_state_renewal(clp); + return 0; + } + + now = jiffies; + status = nfs4_proc_get_lease_time(clp, &fsinfo); + if (status == 0) { + nfs4_set_lease_period(clp, fsinfo.lease_time * HZ, now); + nfs4_schedule_state_renewal(clp); + } + + return status; +} + int nfs4_init_clientid(struct nfs_client *clp, const struct cred *cred) { struct nfs4_setclientid_res clid = { @@ -286,27 +307,6 @@ static int nfs4_begin_drain_session(struct nfs_client *clp) #if defined(CONFIG_NFS_V4_1) -static int nfs4_setup_state_renewal(struct nfs_client *clp) -{ - int status; - struct nfs_fsinfo fsinfo; - unsigned long now; - - if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) { - nfs4_schedule_state_renewal(clp); - return 0; - } - - now = jiffies; - status = nfs4_proc_get_lease_time(clp, &fsinfo); - if (status == 0) { - nfs4_set_lease_period(clp, fsinfo.lease_time * HZ, now); - nfs4_schedule_state_renewal(clp); - } - - return status; -} - static void nfs41_finish_session_reset(struct nfs_client *clp) { clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); From patchwork Fri Jun 28 12:36:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Buczek X-Patchwork-Id: 11022339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99E2F14C0 for ; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89C1428481 for ; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE51283F9; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30248283F9 for ; Fri, 28 Jun 2019 12:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfF1MhD (ORCPT ); Fri, 28 Jun 2019 08:37:03 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:36345 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726696AbfF1MhD (ORCPT ); Fri, 28 Jun 2019 08:37:03 -0400 Received: from theinternet.molgen.mpg.de (theinternet.molgen.mpg.de [141.14.31.7]) by mx.molgen.mpg.de (Postfix) with ESMTP id DCA1020669590; Fri, 28 Jun 2019 14:37:01 +0200 (CEST) From: Donald Buczek To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: Donald Buczek Subject: [PATCH 4/4 RESEND] nfs4.0: Refetch lease_time after clientid update Date: Fri, 28 Jun 2019 14:36:40 +0200 Message-Id: <20190628123640.8715-5-buczek@molgen.mpg.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628123640.8715-1-buczek@molgen.mpg.de> References: <20190628123640.8715-1-buczek@molgen.mpg.de> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP RFC 7530 requires us to refetch the lease time attribute once a new clientID is established. This is already implemented for the nfs4.1(+) clients by nfs41_init_clientid, which calls nfs41_finish_session_reset, which calls nfs4_setup_state_renewal. Let nfs4_init_clientid, which is used for 4.0 clients, call nfs4_setup_state_renewal as well. Signed-off-by: Donald Buczek --- fs/nfs/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index c2df257f426f..f32b02c2bc73 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -135,7 +135,7 @@ int nfs4_init_clientid(struct nfs_client *clp, const struct cred *cred) if (status != 0) goto out; clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); - nfs4_schedule_state_renewal(clp); + nfs4_setup_state_renewal(clp); out: return status; }