aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/lockd
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 13:16:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 16:07:42 -0400
commitecdbf769b2cb8903e07cd482334c714d89fd1146 (patch)
tree9d02ce4daee662c2711762564662cebc521e3da3 /include/linux/lockd
parent4f15e2b1f4f3a56e46201714b39436c32218d547 (diff)
[PATCH] NLM: fix a client-side race on blocking locks.
If the lock blocks, the server may send us a GRANTED message that races with the reply to our LOCK request. Make sure that we catch the GRANTED by queueing up our request on the nlm_blocked list before we send off the first LOCK rpc call. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/lockd')
-rw-r--r--include/linux/lockd/lockd.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 0d9d2257821..16d4e5a08e1 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -72,6 +72,8 @@ struct nlm_lockowner {
72 uint32_t pid; 72 uint32_t pid;
73}; 73};
74 74
75struct nlm_wait;
76
75/* 77/*
76 * Memory chunk for NLM client RPC request. 78 * Memory chunk for NLM client RPC request.
77 */ 79 */
@@ -81,6 +83,7 @@ struct nlm_rqst {
81 struct nlm_host * a_host; /* host handle */ 83 struct nlm_host * a_host; /* host handle */
82 struct nlm_args a_args; /* arguments */ 84 struct nlm_args a_args; /* arguments */
83 struct nlm_res a_res; /* result */ 85 struct nlm_res a_res; /* result */
86 struct nlm_wait * a_block;
84 char a_owner[NLMCLNT_OHSIZE]; 87 char a_owner[NLMCLNT_OHSIZE];
85}; 88};
86 89
@@ -142,7 +145,9 @@ extern unsigned long nlmsvc_timeout;
142 * Lockd client functions 145 * Lockd client functions
143 */ 146 */
144struct nlm_rqst * nlmclnt_alloc_call(void); 147struct nlm_rqst * nlmclnt_alloc_call(void);
145int nlmclnt_block(struct nlm_host *, struct file_lock *, u32 *); 148int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl);
149void nlmclnt_finish_block(struct nlm_rqst *req);
150long nlmclnt_block(struct nlm_rqst *req, long timeout);
146int nlmclnt_cancel(struct nlm_host *, struct file_lock *); 151int nlmclnt_cancel(struct nlm_host *, struct file_lock *);
147u32 nlmclnt_grant(struct nlm_lock *); 152u32 nlmclnt_grant(struct nlm_lock *);
148void nlmclnt_recovery(struct nlm_host *, u32); 153void nlmclnt_recovery(struct nlm_host *, u32);