]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/lockd/svc4proc.c
Don't ask twice about not including staging drivers
[linux-2.6-omap-h63xx.git] / fs / lockd / svc4proc.c
index f6f18fa5cf8baf0720fccb6c1c589cc69dfd7d1b..4dfdcbc6bf6858e626ad99218a0b2abf254424b4 100644 (file)
@@ -220,7 +220,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
        resp->cookie = argp->cookie;
 
        dprintk("lockd: GRANTED       called\n");
-       resp->status = nlmclnt_grant(svc_addr_in(rqstp), &argp->lock);
+       resp->status = nlmclnt_grant(svc_addr(rqstp), &argp->lock);
        dprintk("lockd: GRANTED       status %d\n", ntohl(resp->status));
        return rpc_success;
 }
@@ -421,11 +421,9 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
 {
        struct sockaddr_in      saddr;
 
-       memcpy(&saddr, svc_addr_in(rqstp), sizeof(saddr));
-
        dprintk("lockd: SM_NOTIFY     called\n");
-       if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
-        || ntohs(saddr.sin_port) >= 1024) {
+
+       if (!nlm_privileged_requester(rqstp)) {
                char buf[RPC_MAX_ADDRBUFLEN];
                printk(KERN_WARNING "lockd: rejected NSM callback from %s\n",
                                svc_print_addr(rqstp, buf, sizeof(buf)));
@@ -436,6 +434,7 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
         * reclaim all locks we hold on this server.
         */
        memset(&saddr, 0, sizeof(saddr));
+       saddr.sin_family = AF_INET;
        saddr.sin_addr.s_addr = argp->addr;
        nlm_host_rebooted(&saddr, argp->mon, argp->len, argp->state);