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

Commit 595947ac authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd4: set shorter timeout



We tried to do something overly complicated with the callback rpc
timeouts here.  And they're wrong--the result is that by the time a
single callback times out, it's already too late to tell the client
(using the cb_path_down return to RENEW) that the callback is down.

Use a much shorter, simpler timeout.

Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent f64f79ea
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -358,6 +358,11 @@ static struct rpc_program cb_program = {
		.pipe_dir_name  = "/nfsd4_cb",
};

static int max_cb_time(void)
{
	return max(NFSD_LEASE_TIME/10, (time_t)1) * HZ;
}

/* Reference counting, callback cleanup, etc., all look racy as heck.
 * And why is cb_set an atomic? */

@@ -366,10 +371,8 @@ static struct rpc_clnt *setup_callback_client(struct nfs4_client *clp)
	struct sockaddr_in	addr;
	struct nfs4_callback    *cb = &clp->cl_callback;
	struct rpc_timeout	timeparms = {
		.to_initval	= (NFSD_LEASE_TIME/4) * HZ,
		.to_retries	= 5,
		.to_maxval	= (NFSD_LEASE_TIME/2) * HZ,
		.to_exponential	= 1,
		.to_initval	= max_cb_time(),
		.to_retries	= 0,
	};
	struct rpc_create_args args = {
		.protocol	= IPPROTO_TCP,