fs/lockd/clntproc.c | 2 +- fs/lockd/host.c | 2 +- fs/lockd/mon.c | 21 +++++++++++++-------- fs/lockd/svc4proc.c | 2 +- fs/lockd/svcproc.c | 2 +- include/linux/lockd/sm_inter.h | 5 +++-- 6 files changed, 20 insertions(+), 14 deletions(-) --- linux-2.6.17-2/include/linux/lockd/sm_inter.h 2006-06-27 22:52:32.000000000 -0400 +++ linux-2.6.17-3/include/linux/lockd/sm_inter.h 2006-06-28 23:20:02.000000000 -0400 @@ -25,6 +25,7 @@ */ struct nsm_args { u32 addr; /* remote address */ + u32 serv; /* server ip address */ u32 prog; /* RPC callback info */ u32 vers; u32 proc; @@ -39,8 +40,8 @@ struct nsm_res { u32 state; }; -int nsm_monitor(struct nlm_host *); -int nsm_unmonitor(struct nlm_host *); +int nsm_monitor(struct nlm_host *, __u32 *serv_ip); +int nsm_unmonitor(struct nlm_host *, __u32 *serv_ip); extern u32 nsm_local_state; #endif /* LINUX_LOCKD_SM_INTER_H */ --- linux-2.6.17-2/fs/lockd/svc4proc.c 2006-06-28 14:19:24.000000000 -0400 +++ linux-2.6.17-3/fs/lockd/svc4proc.c 2006-06-29 09:10:02.000000000 -0400 @@ -58,7 +58,7 @@ nlm4svc_retrieve_args(struct svc_rqst *r /* Obtain host handle */ if (!(host = nlmsvc_lookup_host(rqstp)) - || (argp->monitor && !host->h_monitored && nsm_monitor(host) < 0)) + || (argp->monitor && !host->h_monitored && nsm_monitor(host, &rqstp->rq_daddr) < 0)) goto no_locks; *hostp = host; --- linux-2.6.17-2/fs/lockd/svcproc.c 2006-06-28 14:19:50.000000000 -0400 +++ linux-2.6.17-3/fs/lockd/svcproc.c 2006-06-29 09:10:02.000000000 -0400 @@ -89,7 +89,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rq /* Obtain host handle */ if (!(host = nlmsvc_lookup_host(rqstp)) - || (argp->monitor && !host->h_monitored && nsm_monitor(host) < 0)) + || (argp->monitor && !host->h_monitored && nsm_monitor(host, &rqstp->rq_daddr) < 0)) goto no_locks; *hostp = host; --- linux-2.6.17-2/fs/lockd/clntproc.c 2006-06-27 22:49:16.000000000 -0400 +++ linux-2.6.17-3/fs/lockd/clntproc.c 2006-06-29 09:10:02.000000000 -0400 @@ -501,7 +501,7 @@ nlmclnt_lock(struct nlm_rqst *req, struc struct nlm_wait *block = NULL; int status = -ENOLCK; - if (!host->h_monitored && nsm_monitor(host) < 0) { + if (!host->h_monitored && nsm_monitor(host,NULL) < 0) { printk(KERN_NOTICE "lockd: failed to monitor %s\n", host->h_name); goto out; --- linux-2.6.17-2/fs/lockd/mon.c 2006-06-27 22:49:16.000000000 -0400 +++ linux-2.6.17-3/fs/lockd/mon.c 2006-06-29 09:21:03.000000000 -0400 @@ -14,7 +14,6 @@ #include #include - #define NLMDBG_FACILITY NLMDBG_MONITOR static struct rpc_clnt * nsm_create(void); @@ -30,7 +29,7 @@ u32 nsm_local_state; * Common procedure for SM_MON/SM_UNMON calls */ static int -nsm_mon_unmon(struct nlm_host *host, u32 proc, struct nsm_res *res) +nsm_mon_unmon(struct nlm_host *host, __u32 *serv_ip, u32 proc, struct nsm_res *res) { struct rpc_clnt *clnt; int status; @@ -47,6 +46,7 @@ nsm_mon_unmon(struct nlm_host *host, u32 } args.addr = host->h_addr.sin_addr.s_addr; + args.serv = *serv_ip; args.proto= (host->h_proto<<1) | host->h_server; args.prog = NLM_PROGRAM; args.vers = host->h_version; @@ -68,14 +68,14 @@ nsm_mon_unmon(struct nlm_host *host, u32 * Set up monitoring of a remote host */ int -nsm_monitor(struct nlm_host *host) +nsm_monitor(struct nlm_host *host, __u32 *serv_ip) { struct nsm_res res; int status; dprintk("lockd: nsm_monitor(%s)\n", host->h_name); - status = nsm_mon_unmon(host, SM_MON, &res); + status = nsm_mon_unmon(host, serv_ip, SM_MON, &res); if (status < 0 || res.status != 0) printk(KERN_NOTICE "lockd: cannot monitor %s\n", host->h_name); @@ -88,14 +88,14 @@ nsm_monitor(struct nlm_host *host) * Cease to monitor remote host */ int -nsm_unmonitor(struct nlm_host *host) +nsm_unmonitor(struct nlm_host *host, __u32 *serv_ip) { struct nsm_res res; int status; dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name); - status = nsm_mon_unmon(host, SM_UNMON, &res); + status = nsm_mon_unmon(host, serv_ip, SM_UNMON, &res); if (status < 0) printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name); else @@ -151,8 +151,13 @@ xdr_encode_common(struct rpc_rqst *rqstp * so this works alright. */ sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr)); - if (!(p = xdr_encode_string(p, buffer)) - || !(p = xdr_encode_string(p, system_utsname.nodename))) + if (!(p = xdr_encode_string(p, buffer))) + return ERR_PTR(-EIO); + if (argp->serv) + sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->serv)); + else + sprintf(buffer, "%s", system_utsname.nodename); + if (!(p = xdr_encode_string(p, buffer))) return ERR_PTR(-EIO); *p++ = htonl(argp->prog); *p++ = htonl(argp->vers); --- linux-2.6.17-2/fs/lockd/host.c 2006-06-27 22:49:14.000000000 -0400 +++ linux-2.6.17-3/fs/lockd/host.c 2006-06-29 09:10:02.000000000 -0400 @@ -329,7 +329,7 @@ nlm_gc_hosts(void) *q = host->h_next; /* Don't unmonitor hosts that have been invalidated */ if (host->h_monitored && !host->h_killed) - nsm_unmonitor(host); + nsm_unmonitor(host, NULL); if ((clnt = host->h_rpcclnt) != NULL) { if (atomic_read(&clnt->cl_users)) { printk(KERN_WARNING