Date: Tue, 07 Mar 2006 07:43:37 +0900 From: Jun Kuriyama <kuriyama@imgsrc.co.jp> To: stable@freebsd.org Subject: rpc.lockd brokenness (2) Message-ID: <7mveururc6.wl%kuriyama@imgsrc.co.jp>
next in thread | raw e-mail | index | archive | help
I'm not yet received enough information to track rpc.lockd problem. As Kris posted before, here is a patch to backout my suspected commit. If someone can easily reproduce this problem, please try with this patch on both of server/client side of rpc.lockd (I'm not sure which of server/client side this affects). http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/80389 http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/84953 Any reports about this patch (OK or still problem) are welcome! Index: lock_proc.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/rpc.lockd/lock_proc.c,v retrieving revision 1.18 retrieving revision 1.17 diff -u -r1.18 -r1.17 --- lock_proc.c 3 Feb 2005 22:21:19 -0000 1.18 +++ lock_proc.c 9 Oct 2004 15:36:13 -0000 1.17 @@ -62,8 +62,6 @@ #define CLIENT_CACHE_SIZE 64 /* No. of client sockets cached */ #define CLIENT_CACHE_LIFETIME 120 /* In seconds */ -#define getrpcaddr(rqstp) (struct sockaddr *)(svc_getrpccaller((rqstp)->rq_xprt)->buf) - static void log_from_addr(const char *, struct svc_req *); static void log_netobj(netobj *obj); static int addrcmp(struct sockaddr *, struct sockaddr *); @@ -196,7 +194,7 @@ { CLIENT *client; struct timeval retry_time, time_now; - int error, i; + int i; const char *netid; struct netconfig *nconf; char host[NI_MAXHOST]; @@ -243,11 +241,9 @@ * Need a host string for clnt_tp_create. Use NI_NUMERICHOST * to avoid DNS lookups. */ - error = getnameinfo(host_addr, host_addr->sa_len, host, sizeof host, - NULL, 0, NI_NUMERICHOST); - if (error != 0) { - syslog(LOG_ERR, "unable to get name string for caller: %s", - gai_strerror(error)); + if (getnameinfo(host_addr, host_addr->sa_len, host, sizeof host, + NULL, 0, NI_NUMERICHOST) != 0) { + syslog(LOG_ERR, "unable to get name string for caller"); return NULL; } @@ -566,7 +562,8 @@ res.cookie = arg->cookie; res.stat.stat = getlock(&arg4, rqstp, LOCK_ASYNC | LOCK_MON); - transmit_result(NLM_LOCK_RES, &res, getrpcaddr(rqstp)); + transmit_result(NLM_LOCK_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -620,7 +617,8 @@ * a lock to cancel, so this call always fails. */ res.stat.stat = unlock(&arg4, LOCK_CANCEL); - transmit_result(NLM_CANCEL_RES, &res, getrpcaddr(rqstp)); + transmit_result(NLM_CANCEL_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -667,7 +665,8 @@ res.stat.stat = unlock(&arg4, 0); res.cookie = arg->cookie; - transmit_result(NLM_UNLOCK_RES, &res, getrpcaddr(rqstp)); + transmit_result(NLM_UNLOCK_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -724,7 +723,8 @@ nlm_granted, NULL, NLM_VERS) == 0 ? nlm_granted : nlm_denied; - transmit_result(NLM_GRANTED_RES, &res, getrpcaddr(rqstp)); + transmit_result(NLM_GRANTED_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -1067,7 +1067,8 @@ res.cookie = arg->cookie; res.stat.stat = getlock(arg, rqstp, LOCK_MON | LOCK_ASYNC | LOCK_V4); - transmit4_result(NLM4_LOCK_RES, &res, getrpcaddr(rqstp)); + transmit4_result(NLM4_LOCK_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -1115,7 +1116,8 @@ * a lock to cancel, so this call always fails. */ res.stat.stat = unlock(&arg->alock, LOCK_CANCEL | LOCK_V4); - transmit4_result(NLM4_CANCEL_RES, &res, getrpcaddr(rqstp)); + transmit4_result(NLM4_CANCEL_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -1156,7 +1158,8 @@ res.stat.stat = unlock(&arg->alock, LOCK_V4); res.cookie = arg->cookie; - transmit4_result(NLM4_UNLOCK_RES, &res, getrpcaddr(rqstp)); + transmit4_result(NLM4_UNLOCK_RES, &res, + (struct sockaddr *)svc_getcaller(rqstp->rq_xprt)); return (NULL); } @@ -1212,7 +1215,8 @@ res.stat.stat = lock_answer(arg->alock.svid, &arg->cookie, nlm4_granted, NULL, NLM_VERS4) == 0 ? nlm4_granted : nlm4_denied; - transmit4_result(NLM4_GRANTED_RES, &res, getrpcaddr(rqstp)); + transmit4_result(NLM4_GRANTED_RES, &res, + (struct sockaddr *)svc_getrpccaller(rqstp->rq_xprt)->buf); return (NULL); } -- Jun Kuriyama <kuriyama@imgsrc.co.jp> // IMG SRC, Inc. <kuriyama@FreeBSD.org> // FreeBSD Project
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7mveururc6.wl%kuriyama>