Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6fb79d4 authored by Andy Adamson's avatar Andy Adamson Committed by Trond Myklebust
Browse files

NFSv4.1: new flag for lease time check



Data servers cannot send nfs4_proc_get_lease_time. but still need to setup
state renewal. Add the NFS_CS_CHECK_LEASE_TIME bit to indicate if the lease
time can be checked.

Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d3b4c9d7
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -1400,6 +1400,15 @@ static int nfs4_set_client(struct nfs_server *server,
		goto error;
		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;
	server->nfs_client = clp;
	dprintk("<-- nfs4_set_client() = 0 [new %p]\n", clp);
	dprintk("<-- nfs4_set_client() = 0 [new %p]\n", clp);
	return 0;
	return 0;
+5 −0
Original line number Original line Diff line number Diff line
@@ -153,6 +153,11 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
	int status;
	int status;
	struct nfs_fsinfo fsinfo;
	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);
	status = nfs4_proc_get_lease_time(clp, &fsinfo);
	if (status == 0) {
	if (status == 0) {
		/* Update lease time and schedule renewal */
		/* Update lease time and schedule renewal */
+1 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ struct nfs_client {
#define NFS_CS_IDMAP		2		/* - idmap started */
#define NFS_CS_IDMAP		2		/* - idmap started */
#define NFS_CS_RENEWD		3		/* - renewd started */
#define NFS_CS_RENEWD		3		/* - renewd started */
#define NFS_CS_STOP_RENEW	4		/* no more state to renew */
#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 */
	struct sockaddr_storage	cl_addr;	/* server identifier */
	size_t			cl_addrlen;
	size_t			cl_addrlen;
	char *			cl_hostname;	/* hostname of server */
	char *			cl_hostname;	/* hostname of server */