diff options
| -rw-r--r-- | fs/lockd/svc4proc.c | 2 | ||||
| -rw-r--r-- | fs/lockd/svclock.c | 12 | ||||
| -rw-r--r-- | fs/lockd/svcproc.c | 2 | ||||
| -rw-r--r-- | include/linux/lockd/lockd.h | 3 |
4 files changed, 7 insertions, 12 deletions
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c index 006a832d46f2..8cfb9daa7c77 100644 --- a/fs/lockd/svc4proc.c +++ b/fs/lockd/svc4proc.c | |||
| @@ -99,7 +99,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 99 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; | 99 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; |
| 100 | 100 | ||
| 101 | /* Now check for conflicting locks */ | 101 | /* Now check for conflicting locks */ |
| 102 | resp->status = nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie); | 102 | resp->status = nlmsvc_testlock(rqstp, file, host, &argp->lock, &resp->lock, &resp->cookie); |
| 103 | if (resp->status == nlm_drop_reply) | 103 | if (resp->status == nlm_drop_reply) |
| 104 | rc = rpc_drop_reply; | 104 | rc = rpc_drop_reply; |
| 105 | else | 105 | else |
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 81aca859bfde..f40afb3a0e69 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
| @@ -460,8 +460,8 @@ out: | |||
| 460 | */ | 460 | */ |
| 461 | __be32 | 461 | __be32 |
| 462 | nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, | 462 | nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, |
| 463 | struct nlm_lock *lock, struct nlm_lock *conflock, | 463 | struct nlm_host *host, struct nlm_lock *lock, |
| 464 | struct nlm_cookie *cookie) | 464 | struct nlm_lock *conflock, struct nlm_cookie *cookie) |
| 465 | { | 465 | { |
| 466 | struct nlm_block *block = NULL; | 466 | struct nlm_block *block = NULL; |
| 467 | int error; | 467 | int error; |
| @@ -479,16 +479,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, | |||
| 479 | 479 | ||
| 480 | if (block == NULL) { | 480 | if (block == NULL) { |
| 481 | struct file_lock *conf = kzalloc(sizeof(*conf), GFP_KERNEL); | 481 | struct file_lock *conf = kzalloc(sizeof(*conf), GFP_KERNEL); |
| 482 | struct nlm_host *host; | ||
| 483 | 482 | ||
| 484 | if (conf == NULL) | 483 | if (conf == NULL) |
| 485 | return nlm_granted; | 484 | return nlm_granted; |
| 486 | /* Create host handle for callback */ | 485 | nlm_get_host(host); |
| 487 | host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); | ||
| 488 | if (host == NULL) { | ||
| 489 | kfree(conf); | ||
| 490 | return nlm_lck_denied_nolocks; | ||
| 491 | } | ||
| 492 | block = nlmsvc_create_block(rqstp, host, file, lock, cookie); | 486 | block = nlmsvc_create_block(rqstp, host, file, lock, cookie); |
| 493 | if (block == NULL) { | 487 | if (block == NULL) { |
| 494 | kfree(conf); | 488 | kfree(conf); |
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index fce3d7039625..e099f589b61b 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c | |||
| @@ -128,7 +128,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 128 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; | 128 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; |
| 129 | 129 | ||
| 130 | /* Now check for conflicting locks */ | 130 | /* Now check for conflicting locks */ |
| 131 | resp->status = cast_status(nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie)); | 131 | resp->status = cast_status(nlmsvc_testlock(rqstp, file, host, &argp->lock, &resp->lock, &resp->cookie)); |
| 132 | if (resp->status == nlm_drop_reply) | 132 | if (resp->status == nlm_drop_reply) |
| 133 | rc = rpc_drop_reply; | 133 | rc = rpc_drop_reply; |
| 134 | else | 134 | else |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 102d928f7206..b27967034b53 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -203,7 +203,8 @@ __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | |||
| 203 | struct nlm_lock *, int, struct nlm_cookie *); | 203 | struct nlm_lock *, int, struct nlm_cookie *); |
| 204 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 204 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
| 205 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, | 205 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, |
| 206 | struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *); | 206 | struct nlm_host *, struct nlm_lock *, |
| 207 | struct nlm_lock *, struct nlm_cookie *); | ||
| 207 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 208 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
| 208 | unsigned long nlmsvc_retry_blocked(void); | 209 | unsigned long nlmsvc_retry_blocked(void); |
| 209 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 210 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
