diff options
-rw-r--r-- | fs/lockd/clntproc.c | 4 | ||||
-rw-r--r-- | include/linux/lockd/lockd.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index b8ecfa1168f3..220058d8616d 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #define NLMDBG_FACILITY NLMDBG_CLIENT | 22 | #define NLMDBG_FACILITY NLMDBG_CLIENT |
23 | #define NLMCLNT_GRACE_WAIT (5*HZ) | 23 | #define NLMCLNT_GRACE_WAIT (5*HZ) |
24 | #define NLMCLNT_POLL_TIMEOUT (30*HZ) | 24 | #define NLMCLNT_POLL_TIMEOUT (30*HZ) |
25 | #define NLMCLNT_MAX_RETRIES 3 | ||
25 | 26 | ||
26 | static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); | 27 | static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); |
27 | static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *); | 28 | static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *); |
@@ -802,6 +803,9 @@ die: | |||
802 | return; | 803 | return; |
803 | 804 | ||
804 | retry_cancel: | 805 | retry_cancel: |
806 | /* Don't ever retry more than 3 times */ | ||
807 | if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) | ||
808 | goto die; | ||
805 | nlm_rebind_host(req->a_host); | 809 | nlm_rebind_host(req->a_host); |
806 | rpc_restart_call(task); | 810 | rpc_restart_call(task); |
807 | rpc_delay(task, 30 * HZ); | 811 | rpc_delay(task, 30 * HZ); |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index afe9a8f5c5ae..920766cea79c 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -84,6 +84,7 @@ struct nlm_rqst { | |||
84 | struct nlm_args a_args; /* arguments */ | 84 | struct nlm_args a_args; /* arguments */ |
85 | struct nlm_res a_res; /* result */ | 85 | struct nlm_res a_res; /* result */ |
86 | struct nlm_wait * a_block; | 86 | struct nlm_wait * a_block; |
87 | unsigned int a_retries; /* Retry count */ | ||
87 | char a_owner[NLMCLNT_OHSIZE]; | 88 | char a_owner[NLMCLNT_OHSIZE]; |
88 | }; | 89 | }; |
89 | 90 | ||