Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NLM: Ensure that nlmclnt_cancel_callback() doesn't loop forever

If the server returns NLM_LCK_DENIED_NOLOCKS, we currently retry the
entire NLM_CANCEL request. This may end up looping forever unless the
server changes its mind (why would it do that, though?).

Ensure that we limit the number of retries (to 3).

See bug# 5957 in bugzilla.kernel.org.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+5
+4
fs/lockd/clntproc.c
··· 22 22 #define NLMDBG_FACILITY NLMDBG_CLIENT 23 23 #define NLMCLNT_GRACE_WAIT (5*HZ) 24 24 #define NLMCLNT_POLL_TIMEOUT (30*HZ) 25 + #define NLMCLNT_MAX_RETRIES 3 25 26 26 27 static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); 27 28 static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *); ··· 803 802 return; 804 803 805 804 retry_cancel: 805 + /* Don't ever retry more than 3 times */ 806 + if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) 807 + goto die; 806 808 nlm_rebind_host(req->a_host); 807 809 rpc_restart_call(task); 808 810 rpc_delay(task, 30 * HZ);
+1
include/linux/lockd/lockd.h
··· 84 84 struct nlm_args a_args; /* arguments */ 85 85 struct nlm_res a_res; /* result */ 86 86 struct nlm_wait * a_block; 87 + unsigned int a_retries; /* Retry count */ 87 88 char a_owner[NLMCLNT_OHSIZE]; 88 89 }; 89 90