diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-03-05 17:18:10 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-29 16:44:40 -0400 |
commit | 595947acaaef373445131471a78650003f5d8e7d (patch) | |
tree | 706a17e13c60f802678964c6720486abfc33a5bc /fs | |
parent | f64f79ea5f5e02ba8585f35a10b4a3bcab0cea52 (diff) |
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: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 290289bd44f7..049f052a6eb3 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -358,6 +358,11 @@ static struct rpc_program cb_program = { | |||
358 | .pipe_dir_name = "/nfsd4_cb", | 358 | .pipe_dir_name = "/nfsd4_cb", |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static int max_cb_time(void) | ||
362 | { | ||
363 | return max(NFSD_LEASE_TIME/10, (time_t)1) * HZ; | ||
364 | } | ||
365 | |||
361 | /* Reference counting, callback cleanup, etc., all look racy as heck. | 366 | /* Reference counting, callback cleanup, etc., all look racy as heck. |
362 | * And why is cb_set an atomic? */ | 367 | * And why is cb_set an atomic? */ |
363 | 368 | ||
@@ -366,10 +371,8 @@ static struct rpc_clnt *setup_callback_client(struct nfs4_client *clp) | |||
366 | struct sockaddr_in addr; | 371 | struct sockaddr_in addr; |
367 | struct nfs4_callback *cb = &clp->cl_callback; | 372 | struct nfs4_callback *cb = &clp->cl_callback; |
368 | struct rpc_timeout timeparms = { | 373 | struct rpc_timeout timeparms = { |
369 | .to_initval = (NFSD_LEASE_TIME/4) * HZ, | 374 | .to_initval = max_cb_time(), |
370 | .to_retries = 5, | 375 | .to_retries = 0, |
371 | .to_maxval = (NFSD_LEASE_TIME/2) * HZ, | ||
372 | .to_exponential = 1, | ||
373 | }; | 376 | }; |
374 | struct rpc_create_args args = { | 377 | struct rpc_create_args args = { |
375 | .protocol = IPPROTO_TCP, | 378 | .protocol = IPPROTO_TCP, |