diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 15:31:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 15:31:14 -0400 |
| commit | 8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (patch) | |
| tree | d610c8d39246c33c499ee9d92d302d3ca9e89ae3 /fs/lockd/svcproc.c | |
| parent | c269bc00fcb876ae3b85f178f1e34601185c8ccc (diff) | |
| parent | 107e0008dfb8bd6366bc8827f5bbbc0c1f795d2d (diff) | |
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.28' of git://linux-nfs.org/~bfields/linux: (59 commits)
svcrdma: Fix IRD/ORD polarity
svcrdma: Update svc_rdma_send_error to use DMA LKEY
svcrdma: Modify the RPC reply path to use FRMR when available
svcrdma: Modify the RPC recv path to use FRMR when available
svcrdma: Add support to svc_rdma_send to handle chained WR
svcrdma: Modify post recv path to use local dma key
svcrdma: Add a service to register a Fast Reg MR with the device
svcrdma: Query device for Fast Reg support during connection setup
svcrdma: Add FRMR get/put services
NLM: Remove unused argument from svc_addsock() function
NLM: Remove "proto" argument from lockd_up()
NLM: Always start both UDP and TCP listeners
lockd: Remove unused fields in the nlm_reboot structure
lockd: Add helper to sanity check incoming NOTIFY requests
lockd: change nlmclnt_grant() to take a "struct sockaddr *"
lockd: Adjust nlmsvc_lookup_host() to accomodate AF_INET6 addresses
lockd: Adjust nlmclnt_lookup_host() signature to accomodate non-AF_INET
lockd: Support non-AF_INET addresses in nlm_lookup_host()
NLM: Convert nlm_lookup_host() to use a single argument
svcrdma: Add Fast Reg MR Data Types
...
Diffstat (limited to 'fs/lockd/svcproc.c')
| -rw-r--r-- | fs/lockd/svcproc.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index 76262c1986f2..548b0bb2b84d 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c | |||
| @@ -117,12 +117,6 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 117 | dprintk("lockd: TEST called\n"); | 117 | dprintk("lockd: TEST called\n"); |
| 118 | resp->cookie = argp->cookie; | 118 | resp->cookie = argp->cookie; |
| 119 | 119 | ||
| 120 | /* Don't accept test requests during grace period */ | ||
| 121 | if (nlmsvc_grace_period) { | ||
| 122 | resp->status = nlm_lck_denied_grace_period; | ||
| 123 | return rc; | ||
| 124 | } | ||
| 125 | |||
| 126 | /* Obtain client and file */ | 120 | /* Obtain client and file */ |
| 127 | if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) | 121 | if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) |
| 128 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; | 122 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; |
| @@ -152,12 +146,6 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 152 | 146 | ||
| 153 | resp->cookie = argp->cookie; | 147 | resp->cookie = argp->cookie; |
| 154 | 148 | ||
| 155 | /* Don't accept new lock requests during grace period */ | ||
| 156 | if (nlmsvc_grace_period && !argp->reclaim) { | ||
| 157 | resp->status = nlm_lck_denied_grace_period; | ||
| 158 | return rc; | ||
| 159 | } | ||
| 160 | |||
| 161 | /* Obtain client and file */ | 149 | /* Obtain client and file */ |
| 162 | if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) | 150 | if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) |
| 163 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; | 151 | return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; |
| @@ -176,7 +164,8 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 176 | 164 | ||
| 177 | /* Now try to lock the file */ | 165 | /* Now try to lock the file */ |
| 178 | resp->status = cast_status(nlmsvc_lock(rqstp, file, host, &argp->lock, | 166 | resp->status = cast_status(nlmsvc_lock(rqstp, file, host, &argp->lock, |
| 179 | argp->block, &argp->cookie)); | 167 | argp->block, &argp->cookie, |
| 168 | argp->reclaim)); | ||
| 180 | if (resp->status == nlm_drop_reply) | 169 | if (resp->status == nlm_drop_reply) |
| 181 | rc = rpc_drop_reply; | 170 | rc = rpc_drop_reply; |
| 182 | else | 171 | else |
| @@ -199,7 +188,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 199 | resp->cookie = argp->cookie; | 188 | resp->cookie = argp->cookie; |
| 200 | 189 | ||
| 201 | /* Don't accept requests during grace period */ | 190 | /* Don't accept requests during grace period */ |
| 202 | if (nlmsvc_grace_period) { | 191 | if (locks_in_grace()) { |
| 203 | resp->status = nlm_lck_denied_grace_period; | 192 | resp->status = nlm_lck_denied_grace_period; |
| 204 | return rpc_success; | 193 | return rpc_success; |
| 205 | } | 194 | } |
| @@ -232,7 +221,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 232 | resp->cookie = argp->cookie; | 221 | resp->cookie = argp->cookie; |
| 233 | 222 | ||
| 234 | /* Don't accept new lock requests during grace period */ | 223 | /* Don't accept new lock requests during grace period */ |
| 235 | if (nlmsvc_grace_period) { | 224 | if (locks_in_grace()) { |
| 236 | resp->status = nlm_lck_denied_grace_period; | 225 | resp->status = nlm_lck_denied_grace_period; |
| 237 | return rpc_success; | 226 | return rpc_success; |
| 238 | } | 227 | } |
| @@ -261,7 +250,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 261 | resp->cookie = argp->cookie; | 250 | resp->cookie = argp->cookie; |
| 262 | 251 | ||
| 263 | dprintk("lockd: GRANTED called\n"); | 252 | dprintk("lockd: GRANTED called\n"); |
| 264 | resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock); | 253 | resp->status = nlmclnt_grant(svc_addr(rqstp), &argp->lock); |
| 265 | dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); | 254 | dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); |
| 266 | return rpc_success; | 255 | return rpc_success; |
| 267 | } | 256 | } |
| @@ -373,7 +362,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 373 | resp->cookie = argp->cookie; | 362 | resp->cookie = argp->cookie; |
| 374 | 363 | ||
| 375 | /* Don't accept new lock requests during grace period */ | 364 | /* Don't accept new lock requests during grace period */ |
| 376 | if (nlmsvc_grace_period && !argp->reclaim) { | 365 | if (locks_in_grace() && !argp->reclaim) { |
| 377 | resp->status = nlm_lck_denied_grace_period; | 366 | resp->status = nlm_lck_denied_grace_period; |
| 378 | return rpc_success; | 367 | return rpc_success; |
| 379 | } | 368 | } |
| @@ -406,7 +395,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp, | |||
| 406 | resp->cookie = argp->cookie; | 395 | resp->cookie = argp->cookie; |
| 407 | 396 | ||
| 408 | /* Don't accept requests during grace period */ | 397 | /* Don't accept requests during grace period */ |
| 409 | if (nlmsvc_grace_period) { | 398 | if (locks_in_grace()) { |
| 410 | resp->status = nlm_lck_denied_grace_period; | 399 | resp->status = nlm_lck_denied_grace_period; |
| 411 | return rpc_success; | 400 | return rpc_success; |
| 412 | } | 401 | } |
| @@ -464,11 +453,9 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, | |||
| 464 | { | 453 | { |
| 465 | struct sockaddr_in saddr; | 454 | struct sockaddr_in saddr; |
| 466 | 455 | ||
| 467 | memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr)); | ||
| 468 | |||
| 469 | dprintk("lockd: SM_NOTIFY called\n"); | 456 | dprintk("lockd: SM_NOTIFY called\n"); |
| 470 | if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK) | 457 | |
| 471 | || ntohs(saddr.sin_port) >= 1024) { | 458 | if (!nlm_privileged_requester(rqstp)) { |
| 472 | char buf[RPC_MAX_ADDRBUFLEN]; | 459 | char buf[RPC_MAX_ADDRBUFLEN]; |
| 473 | printk(KERN_WARNING "lockd: rejected NSM callback from %s\n", | 460 | printk(KERN_WARNING "lockd: rejected NSM callback from %s\n", |
| 474 | svc_print_addr(rqstp, buf, sizeof(buf))); | 461 | svc_print_addr(rqstp, buf, sizeof(buf))); |
