From patchwork Tue Feb 15 08:38:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 568031 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1GId3qJ024617 for ; Wed, 16 Feb 2011 18:39:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752735Ab1BPSjH (ORCPT ); Wed, 16 Feb 2011 13:39:07 -0500 Received: from mx2.netapp.com ([216.240.18.37]:34958 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752853Ab1BPSjE (ORCPT ); Wed, 16 Feb 2011 13:39:04 -0500 X-IronPort-AV: E=Sophos;i="4.60,480,1291622400"; d="scan'208";a="519310015" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 16 Feb 2011 10:39:03 -0800 Received: from fedora-3.dros.org (lenovo-6284dfc6.hq.netapp.com [10.58.50.68] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p1GIcv7u024776; Wed, 16 Feb 2011 10:39:02 -0800 (PST) From: andros@netapp.com To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org, Andy Adamson Subject: [PATCH pNFS wave 3 Version 2 06/18] NFSv4.1: new flag for lease time check Date: Tue, 15 Feb 2011 03:38:51 -0500 Message-Id: <1297759143-2045-7-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1297759143-2045-1-git-send-email-andros@netapp.com> References: <1297759143-2045-1-git-send-email-andros@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Feb 2011 18:39:09 +0000 (UTC) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index a86698c..280d41f6 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1400,6 +1400,15 @@ static int nfs4_set_client(struct nfs_server *server, goto error; } + /* + * Query for the lease time on clientid setup or renewal + * + * Note that this will be set on nfs_clients that were created + * only for the DS role and did not set this bit, but now will + * serve a dual role. + */ + set_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state); + server->nfs_client = clp; dprintk("<-- nfs4_set_client() = 0 [new %p]\n", clp); return 0; diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index e6742b5..9e33e88 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -153,6 +153,11 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp) int status; struct nfs_fsinfo fsinfo; + if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) { + nfs4_schedule_state_renewal(clp); + return 0; + } + status = nfs4_proc_get_lease_time(clp, &fsinfo); if (status == 0) { /* Update lease time and schedule renewal */ diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 2c2dc18..2669a9a 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -31,6 +31,7 @@ struct nfs_client { #define NFS_CS_IDMAP 2 /* - idmap started */ #define NFS_CS_RENEWD 3 /* - renewd started */ #define NFS_CS_STOP_RENEW 4 /* no more state to renew */ +#define NFS_CS_CHECK_LEASE_TIME 5 /* need to check lease time */ struct sockaddr_storage cl_addr; /* server identifier */ size_t cl_addrlen; char * cl_hostname; /* hostname of server */