From 2a6b210d8b5f4589d5a99531f38ee17ecdb136e9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:18:25 -0500 Subject: [PATCH] --- yaml --- r: 19471 b: refs/heads/master c: aaaa99423b4b1f9cfd33ea5643d9274c25f62491 h: refs/heads/master i: 19469: 6c7d71c0e98ce7c4b393b1ffd53791a4704018a8 19467: 3311ce2f4cabfdfbaf3e91b891f39be3c0825d02 19463: 924f31e28249e3e25c75edbdbc1795b57c1ac309 19455: 817dcf06711f146c87653a617271eb1ca79eb142 v: v3 --- [refs] | 2 +- trunk/fs/lockd/clntproc.c | 4 ++++ trunk/include/linux/lockd/lockd.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 730f803b1544..39790e9f05b1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 16fb24252a8170799e7adf14d8fc31b817fcaf53 +refs/heads/master: aaaa99423b4b1f9cfd33ea5643d9274c25f62491 diff --git a/trunk/fs/lockd/clntproc.c b/trunk/fs/lockd/clntproc.c index b8ecfa1168f3..220058d8616d 100644 --- a/trunk/fs/lockd/clntproc.c +++ b/trunk/fs/lockd/clntproc.c @@ -22,6 +22,7 @@ #define NLMDBG_FACILITY NLMDBG_CLIENT #define NLMCLNT_GRACE_WAIT (5*HZ) #define NLMCLNT_POLL_TIMEOUT (30*HZ) +#define NLMCLNT_MAX_RETRIES 3 static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *); @@ -802,6 +803,9 @@ static void nlmclnt_cancel_callback(struct rpc_task *task, void *data) return; retry_cancel: + /* Don't ever retry more than 3 times */ + if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) + goto die; nlm_rebind_host(req->a_host); rpc_restart_call(task); rpc_delay(task, 30 * HZ); diff --git a/trunk/include/linux/lockd/lockd.h b/trunk/include/linux/lockd/lockd.h index afe9a8f5c5ae..920766cea79c 100644 --- a/trunk/include/linux/lockd/lockd.h +++ b/trunk/include/linux/lockd/lockd.h @@ -84,6 +84,7 @@ struct nlm_rqst { struct nlm_args a_args; /* arguments */ struct nlm_res a_res; /* result */ struct nlm_wait * a_block; + unsigned int a_retries; /* Retry count */ char a_owner[NLMCLNT_OHSIZE]; };