aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
commitd9bc125caf592b7d081021f32ce5b717efdf70c8 (patch)
tree263b7066ba22ddce21db610c0300f6eaac6f2064 /fs/lockd
parent43d78ef2ba5bec26d0315859e8324bfc0be23766 (diff)
parentec2f9d1331f658433411c58077871e1eef4ee1b4 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts: net/sunrpc/auth_gss/gss_krb5_crypto.c net/sunrpc/auth_gss/gss_spkm3_token.c net/sunrpc/clnt.c Merge with mainline and fix conflicts.
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/host.c2
-rw-r--r--fs/lockd/svc.c32
-rw-r--r--fs/lockd/svc4proc.c13
-rw-r--r--fs/lockd/svcproc.c13
4 files changed, 34 insertions, 26 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 3d4610c2a266..22d403208973 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -192,7 +192,7 @@ struct nlm_host *
192nlmsvc_lookup_host(struct svc_rqst *rqstp, 192nlmsvc_lookup_host(struct svc_rqst *rqstp,
193 const char *hostname, int hostname_len) 193 const char *hostname, int hostname_len)
194{ 194{
195 return nlm_lookup_host(1, &rqstp->rq_addr, 195 return nlm_lookup_host(1, svc_addr_in(rqstp),
196 rqstp->rq_prot, rqstp->rq_vers, 196 rqstp->rq_prot, rqstp->rq_vers,
197 hostname, hostname_len); 197 hostname, hostname_len);
198} 198}
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 8ca18085e68d..80fcacc1acf9 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -141,6 +141,7 @@ lockd(struct svc_rqst *rqstp)
141 */ 141 */
142 while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) { 142 while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) {
143 long timeout = MAX_SCHEDULE_TIMEOUT; 143 long timeout = MAX_SCHEDULE_TIMEOUT;
144 char buf[RPC_MAX_ADDRBUFLEN];
144 145
145 if (signalled()) { 146 if (signalled()) {
146 flush_signals(current); 147 flush_signals(current);
@@ -175,11 +176,10 @@ lockd(struct svc_rqst *rqstp)
175 break; 176 break;
176 } 177 }
177 178
178 dprintk("lockd: request from %08x\n", 179 dprintk("lockd: request from %s\n",
179 (unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr)); 180 svc_print_addr(rqstp, buf, sizeof(buf)));
180 181
181 svc_process(rqstp); 182 svc_process(rqstp);
182
183 } 183 }
184 184
185 flush_signals(current); 185 flush_signals(current);
@@ -223,23 +223,29 @@ static int find_socket(struct svc_serv *serv, int proto)
223 return found; 223 return found;
224} 224}
225 225
226/*
227 * Make any sockets that are needed but not present.
228 * If nlm_udpport or nlm_tcpport were set as module
229 * options, make those sockets unconditionally
230 */
226static int make_socks(struct svc_serv *serv, int proto) 231static int make_socks(struct svc_serv *serv, int proto)
227{ 232{
228 /* Make any sockets that are needed but not present. 233 static int warned;
229 * If nlm_udpport or nlm_tcpport were set as module
230 * options, make those sockets unconditionally
231 */
232 static int warned;
233 int err = 0; 234 int err = 0;
235
234 if (proto == IPPROTO_UDP || nlm_udpport) 236 if (proto == IPPROTO_UDP || nlm_udpport)
235 if (!find_socket(serv, IPPROTO_UDP)) 237 if (!find_socket(serv, IPPROTO_UDP))
236 err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport); 238 err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport,
237 if (err == 0 && (proto == IPPROTO_TCP || nlm_tcpport)) 239 SVC_SOCK_DEFAULTS);
240 if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
238 if (!find_socket(serv, IPPROTO_TCP)) 241 if (!find_socket(serv, IPPROTO_TCP))
239 err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport); 242 err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport,
240 if (!err) 243 SVC_SOCK_DEFAULTS);
244
245 if (err >= 0) {
241 warned = 0; 246 warned = 0;
242 else if (warned++ == 0) 247 err = 0;
248 } else if (warned++ == 0)
243 printk(KERN_WARNING 249 printk(KERN_WARNING
244 "lockd_up: makesock failed, error=%d\n", err); 250 "lockd_up: makesock failed, error=%d\n", err);
245 return err; 251 return err;
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index f67146a8199a..47a66aa5d55b 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -224,7 +224,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
224 resp->cookie = argp->cookie; 224 resp->cookie = argp->cookie;
225 225
226 dprintk("lockd: GRANTED called\n"); 226 dprintk("lockd: GRANTED called\n");
227 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock); 227 resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock);
228 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 228 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
229 return rpc_success; 229 return rpc_success;
230} 230}
@@ -421,15 +421,16 @@ static __be32
421nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, 421nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
422 void *resp) 422 void *resp)
423{ 423{
424 struct sockaddr_in saddr = rqstp->rq_addr; 424 struct sockaddr_in saddr;
425
426 memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr));
425 427
426 dprintk("lockd: SM_NOTIFY called\n"); 428 dprintk("lockd: SM_NOTIFY called\n");
427 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK) 429 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
428 || ntohs(saddr.sin_port) >= 1024) { 430 || ntohs(saddr.sin_port) >= 1024) {
429 printk(KERN_WARNING 431 char buf[RPC_MAX_ADDRBUFLEN];
430 "lockd: rejected NSM callback from %08x:%d\n", 432 printk(KERN_WARNING "lockd: rejected NSM callback from %s\n",
431 ntohl(rqstp->rq_addr.sin_addr.s_addr), 433 svc_print_addr(rqstp, buf, sizeof(buf)));
432 ntohs(rqstp->rq_addr.sin_port));
433 return rpc_system_err; 434 return rpc_system_err;
434 } 435 }
435 436
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 3707c3a23e93..31cb48425733 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -253,7 +253,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
253 resp->cookie = argp->cookie; 253 resp->cookie = argp->cookie;
254 254
255 dprintk("lockd: GRANTED called\n"); 255 dprintk("lockd: GRANTED called\n");
256 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock); 256 resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock);
257 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 257 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
258 return rpc_success; 258 return rpc_success;
259} 259}
@@ -452,15 +452,16 @@ static __be32
452nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, 452nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
453 void *resp) 453 void *resp)
454{ 454{
455 struct sockaddr_in saddr = rqstp->rq_addr; 455 struct sockaddr_in saddr;
456
457 memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr));
456 458
457 dprintk("lockd: SM_NOTIFY called\n"); 459 dprintk("lockd: SM_NOTIFY called\n");
458 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK) 460 if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
459 || ntohs(saddr.sin_port) >= 1024) { 461 || ntohs(saddr.sin_port) >= 1024) {
460 printk(KERN_WARNING 462 char buf[RPC_MAX_ADDRBUFLEN];
461 "lockd: rejected NSM callback from %08x:%d\n", 463 printk(KERN_WARNING "lockd: rejected NSM callback from %s\n",
462 ntohl(rqstp->rq_addr.sin_addr.s_addr), 464 svc_print_addr(rqstp, buf, sizeof(buf)));
463 ntohs(rqstp->rq_addr.sin_port));
464 return rpc_system_err; 465 return rpc_system_err;
465 } 466 }
466 467