diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:31 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:42 -0400 |
commit | ecdbf769b2cb8903e07cd482334c714d89fd1146 (patch) | |
tree | 9d02ce4daee662c2711762564662cebc521e3da3 /include | |
parent | 4f15e2b1f4f3a56e46201714b39436c32218d547 (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')
-rw-r--r-- | include/linux/lockd/lockd.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0d9d22578212..16d4e5a08e1d 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 | ||
75 | struct 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 | */ |
144 | struct nlm_rqst * nlmclnt_alloc_call(void); | 147 | struct nlm_rqst * nlmclnt_alloc_call(void); |
145 | int nlmclnt_block(struct nlm_host *, struct file_lock *, u32 *); | 148 | int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); |
149 | void nlmclnt_finish_block(struct nlm_rqst *req); | ||
150 | long nlmclnt_block(struct nlm_rqst *req, long timeout); | ||
146 | int nlmclnt_cancel(struct nlm_host *, struct file_lock *); | 151 | int nlmclnt_cancel(struct nlm_host *, struct file_lock *); |
147 | u32 nlmclnt_grant(struct nlm_lock *); | 152 | u32 nlmclnt_grant(struct nlm_lock *); |
148 | void nlmclnt_recovery(struct nlm_host *, u32); | 153 | void nlmclnt_recovery(struct nlm_host *, u32); |