diff options
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/clntproc.c | 14 | ||||
-rw-r--r-- | fs/lockd/svc4proc.c | 1 | ||||
-rw-r--r-- | fs/lockd/svclock.c | 1 | ||||
-rw-r--r-- | fs/lockd/svcproc.c | 1 |
4 files changed, 9 insertions, 8 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 8392cb85bd54..05d29124c6ab 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -156,12 +156,16 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl) | |||
156 | struct nlm_rqst *call; | 156 | struct nlm_rqst *call; |
157 | int status; | 157 | int status; |
158 | 158 | ||
159 | nlm_get_host(host); | ||
160 | call = nlm_alloc_call(host); | 159 | call = nlm_alloc_call(host); |
161 | if (call == NULL) | 160 | if (call == NULL) |
162 | return -ENOMEM; | 161 | return -ENOMEM; |
163 | 162 | ||
164 | nlmclnt_locks_init_private(fl, host); | 163 | nlmclnt_locks_init_private(fl, host); |
164 | if (!fl->fl_u.nfs_fl.owner) { | ||
165 | /* lockowner allocation has failed */ | ||
166 | nlmclnt_release_call(call); | ||
167 | return -ENOMEM; | ||
168 | } | ||
165 | /* Set up the argument struct */ | 169 | /* Set up the argument struct */ |
166 | nlmclnt_setlockargs(call, fl); | 170 | nlmclnt_setlockargs(call, fl); |
167 | 171 | ||
@@ -185,9 +189,6 @@ EXPORT_SYMBOL_GPL(nlmclnt_proc); | |||
185 | 189 | ||
186 | /* | 190 | /* |
187 | * Allocate an NLM RPC call struct | 191 | * Allocate an NLM RPC call struct |
188 | * | ||
189 | * Note: the caller must hold a reference to host. In case of failure, | ||
190 | * this reference will be released. | ||
191 | */ | 192 | */ |
192 | struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) | 193 | struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) |
193 | { | 194 | { |
@@ -199,7 +200,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) | |||
199 | atomic_set(&call->a_count, 1); | 200 | atomic_set(&call->a_count, 1); |
200 | locks_init_lock(&call->a_args.lock.fl); | 201 | locks_init_lock(&call->a_args.lock.fl); |
201 | locks_init_lock(&call->a_res.lock.fl); | 202 | locks_init_lock(&call->a_res.lock.fl); |
202 | call->a_host = host; | 203 | call->a_host = nlm_get_host(host); |
203 | return call; | 204 | return call; |
204 | } | 205 | } |
205 | if (signalled()) | 206 | if (signalled()) |
@@ -207,7 +208,6 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) | |||
207 | printk("nlm_alloc_call: failed, waiting for memory\n"); | 208 | printk("nlm_alloc_call: failed, waiting for memory\n"); |
208 | schedule_timeout_interruptible(5*HZ); | 209 | schedule_timeout_interruptible(5*HZ); |
209 | } | 210 | } |
210 | nlmclnt_release_host(host); | ||
211 | return NULL; | 211 | return NULL; |
212 | } | 212 | } |
213 | 213 | ||
@@ -750,7 +750,7 @@ static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl | |||
750 | dprintk("lockd: blocking lock attempt was interrupted by a signal.\n" | 750 | dprintk("lockd: blocking lock attempt was interrupted by a signal.\n" |
751 | " Attempting to cancel lock.\n"); | 751 | " Attempting to cancel lock.\n"); |
752 | 752 | ||
753 | req = nlm_alloc_call(nlm_get_host(host)); | 753 | req = nlm_alloc_call(host); |
754 | if (!req) | 754 | if (!req) |
755 | return -ENOMEM; | 755 | return -ENOMEM; |
756 | req->a_flags = RPC_TASK_ASYNC; | 756 | req->a_flags = RPC_TASK_ASYNC; |
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c index 4a43d253c045..b147d1ae71fd 100644 --- a/fs/lockd/svc4proc.c +++ b/fs/lockd/svc4proc.c | |||
@@ -257,6 +257,7 @@ static __be32 nlm4svc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args | |||
257 | return rpc_system_err; | 257 | return rpc_system_err; |
258 | 258 | ||
259 | call = nlm_alloc_call(host); | 259 | call = nlm_alloc_call(host); |
260 | nlmsvc_release_host(host); | ||
260 | if (call == NULL) | 261 | if (call == NULL) |
261 | return rpc_system_err; | 262 | return rpc_system_err; |
262 | 263 | ||
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index afe4488c33d8..fb1a2bedbe97 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
@@ -219,7 +219,6 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, | |||
219 | struct nlm_block *block; | 219 | struct nlm_block *block; |
220 | struct nlm_rqst *call = NULL; | 220 | struct nlm_rqst *call = NULL; |
221 | 221 | ||
222 | nlm_get_host(host); | ||
223 | call = nlm_alloc_call(host); | 222 | call = nlm_alloc_call(host); |
224 | if (call == NULL) | 223 | if (call == NULL) |
225 | return NULL; | 224 | return NULL; |
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index de8f2caa2235..3009a365e082 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c | |||
@@ -297,6 +297,7 @@ static __be32 nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args | |||
297 | return rpc_system_err; | 297 | return rpc_system_err; |
298 | 298 | ||
299 | call = nlm_alloc_call(host); | 299 | call = nlm_alloc_call(host); |
300 | nlmsvc_release_host(host); | ||
300 | if (call == NULL) | 301 | if (call == NULL) |
301 | return rpc_system_err; | 302 | return rpc_system_err; |
302 | 303 | ||