diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/clntlock.c linux-2.4.1-reclaim/fs/lockd/clntlock.c --- linux-2.4.1-xprt/fs/lockd/clntlock.c Tue Nov 7 19:18:57 2000 +++ linux-2.4.1-reclaim/fs/lockd/clntlock.c Fri Jan 12 11:55:45 2001 @@ -138,7 +138,7 @@ void nlmclnt_recovery(struct nlm_host *host, u32 newstate) { - if (!host->h_reclaiming++) { + if (host->h_reclaiming++) { if (host->h_nsmstate == newstate) return; printk(KERN_WARNING diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/host.c linux-2.4.1-reclaim/fs/lockd/host.c --- linux-2.4.1-xprt/fs/lockd/host.c Mon Oct 2 05:35:16 2000 +++ linux-2.4.1-reclaim/fs/lockd/host.c Fri Jan 12 11:55:45 2001 @@ -51,7 +51,8 @@ struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *rqstp) { - return nlm_lookup_host(rqstp->rq_client, &rqstp->rq_addr, 0, 0); + return nlm_lookup_host(rqstp->rq_client, &rqstp->rq_addr, + rqstp->rq_prot, rqstp->rq_vers); } /* @@ -97,7 +98,9 @@ nlm_gc_hosts(); for (hp = &nlm_hosts[hash]; (host = *hp); hp = &host->h_next) { - if (host->h_version != version || host->h_proto != proto) + if (proto && host->h_proto != proto) + continue; + if (version && host->h_version != version) continue; if (nlm_match_host(host, clnt, sin)) { diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/mon.c linux-2.4.1-reclaim/fs/lockd/mon.c --- linux-2.4.1-xprt/fs/lockd/mon.c Mon Oct 16 21:58:51 2000 +++ linux-2.4.1-reclaim/fs/lockd/mon.c Fri Jan 12 11:55:45 2001 @@ -43,7 +43,7 @@ args.addr = host->h_addr.sin_addr.s_addr; args.prog = NLM_PROGRAM; - args.vers = 1; + args.vers = host->h_version; args.proc = NLMPROC_NSM_NOTIFY; memset(res, 0, sizeof(*res)); diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/svc.c linux-2.4.1-reclaim/fs/lockd/svc.c --- linux-2.4.1-xprt/fs/lockd/svc.c Fri Dec 29 23:07:23 2000 +++ linux-2.4.1-reclaim/fs/lockd/svc.c Fri Jan 12 11:55:45 2001 @@ -105,10 +105,10 @@ nlmsvc_grace_period = 10 * HZ; #else if (nlm_grace_period) { - nlmsvc_grace_period += (1 + nlm_grace_period / nlm_timeout) + nlmsvc_grace_period = (1 + nlm_grace_period / nlm_timeout) * nlm_timeout * HZ; } else { - nlmsvc_grace_period += 5 * nlm_timeout * HZ; + nlmsvc_grace_period = 5 * nlm_timeout * HZ; } #endif @@ -135,10 +135,12 @@ * (Theoretically, there shouldn't even be blocked locks * during grace period). */ - if (!nlmsvc_grace_period) { + if (!grace_period_expire) { timeout = nlmsvc_retry_blocked(); - } else if (time_before(nlmsvc_grace_period, jiffies)) + } else if (time_before(grace_period_expire, jiffies)) { + grace_period_expire = 0; nlmsvc_grace_period = 0; + } /* * Find a socket with data available and call its @@ -339,7 +341,7 @@ * Define NLM program and procedures */ static struct svc_version nlmsvc_version1 = { - 1, 16, nlmsvc_procedures, NULL + 1, 17, nlmsvc_procedures, NULL }; static struct svc_version nlmsvc_version3 = { 3, 24, nlmsvc_procedures, NULL diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/svc4proc.c linux-2.4.1-reclaim/fs/lockd/svc4proc.c --- linux-2.4.1-xprt/fs/lockd/svc4proc.c Mon Apr 3 22:24:05 2000 +++ linux-2.4.1-reclaim/fs/lockd/svc4proc.c Fri Jan 12 11:55:45 2001 @@ -420,6 +420,8 @@ void *resp) { struct sockaddr_in saddr = rqstp->rq_addr; + int vers = rqstp->rq_vers; + int prot = rqstp->rq_prot; struct nlm_host *host; dprintk("lockd: SM_NOTIFY called\n"); @@ -436,7 +438,7 @@ * reclaim all locks we hold on this server. */ saddr.sin_addr.s_addr = argp->addr; - if ((host = nlm_lookup_host(NULL, &saddr, IPPROTO_UDP, 1)) != NULL) { + if ((host = nlmclnt_lookup_host(&saddr, prot, vers)) != NULL) { nlmclnt_recovery(host, argp->state); nlm_release_host(host); } @@ -549,7 +551,8 @@ PROC(cancel_res, cancelres, norep, res, void), PROC(unlock_res, unlockres, norep, res, void), PROC(granted_res, grantedres, norep, res, void), - PROC(none, void, void, void, void), + /* statd callback */ + PROC(sm_notify, reboot, void, reboot, void), PROC(none, void, void, void, void), PROC(none, void, void, void, void), PROC(none, void, void, void, void), @@ -558,6 +561,4 @@ PROC(nm_lock, lockargs, res, args, res), PROC(free_all, notify, void, args, void), - /* statd callback */ - PROC(sm_notify, reboot, void, reboot, void), }; diff -u --recursive --new-file linux-2.4.1-xprt/fs/lockd/svcproc.c linux-2.4.1-reclaim/fs/lockd/svcproc.c --- linux-2.4.1-xprt/fs/lockd/svcproc.c Mon Apr 3 22:24:06 2000 +++ linux-2.4.1-reclaim/fs/lockd/svcproc.c Fri Jan 12 11:55:45 2001 @@ -445,6 +445,8 @@ void *resp) { struct sockaddr_in saddr = rqstp->rq_addr; + int vers = rqstp->rq_vers; + int prot = rqstp->rq_prot; struct nlm_host *host; dprintk("lockd: SM_NOTIFY called\n"); @@ -460,8 +462,8 @@ /* Obtain the host pointer for this NFS server and try to * reclaim all locks we hold on this server. */ - saddr.sin_addr.s_addr = argp->addr; - if ((host = nlm_lookup_host(NULL, &saddr, IPPROTO_UDP, 1)) != NULL) { + saddr.sin_addr.s_addr = htonl(argp->addr); + if ((host = nlmclnt_lookup_host(&saddr, prot, vers)) != NULL) { nlmclnt_recovery(host, argp->state); nlm_release_host(host); } @@ -574,7 +576,8 @@ PROC(cancel_res, cancelres, norep, res, void), PROC(unlock_res, unlockres, norep, res, void), PROC(granted_res, grantedres, norep, res, void), - PROC(none, void, void, void, void), + /* statd callback */ + PROC(sm_notify, reboot, void, reboot, void), PROC(none, void, void, void, void), PROC(none, void, void, void, void), PROC(none, void, void, void, void), @@ -583,6 +586,4 @@ PROC(nm_lock, lockargs, res, args, res), PROC(free_all, notify, void, args, void), - /* statd callback */ - PROC(sm_notify, reboot, void, reboot, void), }; diff -u --recursive --new-file linux-2.4.1-xprt/include/linux/lockd/nlm.h linux-2.4.1-reclaim/include/linux/lockd/nlm.h --- linux-2.4.1-xprt/include/linux/lockd/nlm.h Mon Dec 11 22:25:38 2000 +++ linux-2.4.1-reclaim/include/linux/lockd/nlm.h Fri Jan 12 12:16:55 2001 @@ -49,10 +49,10 @@ #define NLMPROC_CANCEL_RES 13 #define NLMPROC_UNLOCK_RES 14 #define NLMPROC_GRANTED_RES 15 +#define NLMPROC_NSM_NOTIFY 16 /* statd callback */ #define NLMPROC_SHARE 20 #define NLMPROC_UNSHARE 21 #define NLMPROC_NM_LOCK 22 #define NLMPROC_FREE_ALL 23 -#define NLMPROC_NSM_NOTIFY 24 /* statd callback */ #endif /* LINUX_LOCKD_NLM_H */