aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/svc4proc.c2
-rw-r--r--fs/lockd/svclock.c10
-rw-r--r--fs/lockd/svcproc.c2
-rw-r--r--include/linux/lockd/lockd.h3
4 files changed, 6 insertions, 11 deletions
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 8cfb9daa7c7..189b2ce01da 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -145,7 +145,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
145#endif 145#endif
146 146
147 /* Now try to lock the file */ 147 /* Now try to lock the file */
148 resp->status = nlmsvc_lock(rqstp, file, &argp->lock, 148 resp->status = nlmsvc_lock(rqstp, file, host, &argp->lock,
149 argp->block, &argp->cookie); 149 argp->block, &argp->cookie);
150 if (resp->status == nlm_drop_reply) 150 if (resp->status == nlm_drop_reply)
151 rc = rpc_drop_reply; 151 rc = rpc_drop_reply;
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index f40afb3a0e6..bcf73f6e822 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -358,10 +358,10 @@ nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block)
358 */ 358 */
359__be32 359__be32
360nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, 360nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
361 struct nlm_lock *lock, int wait, struct nlm_cookie *cookie) 361 struct nlm_host *host, struct nlm_lock *lock, int wait,
362 struct nlm_cookie *cookie)
362{ 363{
363 struct nlm_block *block = NULL; 364 struct nlm_block *block = NULL;
364 struct nlm_host *host;
365 int error; 365 int error;
366 __be32 ret; 366 __be32 ret;
367 367
@@ -373,11 +373,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
373 (long long)lock->fl.fl_end, 373 (long long)lock->fl.fl_end,
374 wait); 374 wait);
375 375
376 /* Create host handle for callback */
377 host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len);
378 if (host == NULL)
379 return nlm_lck_denied_nolocks;
380
381 /* Lock file against concurrent access */ 376 /* Lock file against concurrent access */
382 mutex_lock(&file->f_mutex); 377 mutex_lock(&file->f_mutex);
383 /* Get existing block (in case client is busy-waiting) 378 /* Get existing block (in case client is busy-waiting)
@@ -450,7 +445,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
450out: 445out:
451 mutex_unlock(&file->f_mutex); 446 mutex_unlock(&file->f_mutex);
452 nlmsvc_release_block(block); 447 nlmsvc_release_block(block);
453 nlm_release_host(host);
454 dprintk("lockd: nlmsvc_lock returned %u\n", ret); 448 dprintk("lockd: nlmsvc_lock returned %u\n", ret);
455 return ret; 449 return ret;
456} 450}
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index e099f589b61..82dc9083ba6 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -175,7 +175,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
175#endif 175#endif
176 176
177 /* Now try to lock the file */ 177 /* Now try to lock the file */
178 resp->status = cast_status(nlmsvc_lock(rqstp, file, &argp->lock, 178 resp->status = cast_status(nlmsvc_lock(rqstp, file, host, &argp->lock,
179 argp->block, &argp->cookie)); 179 argp->block, &argp->cookie));
180 if (resp->status == nlm_drop_reply) 180 if (resp->status == nlm_drop_reply)
181 rc = rpc_drop_reply; 181 rc = rpc_drop_reply;
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index b27967034b5..f81f9dd5f14 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -200,7 +200,8 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref);
200 * Server-side lock handling 200 * Server-side lock handling
201 */ 201 */
202__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 202__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
203 struct nlm_lock *, int, struct nlm_cookie *); 203 struct nlm_host *, struct nlm_lock *, int,
204 struct nlm_cookie *);
204__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 205__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
205__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, 206__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
206 struct nlm_host *, struct nlm_lock *, 207 struct nlm_host *, struct nlm_lock *,