Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2018 18:21:48 +0000 (UTC)
From:      Sean Eric Fagan <sef@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341641 - head/usr.sbin/mountd
Message-ID:  <201812061821.wB6ILmIK081493@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sef
Date: Thu Dec  6 18:21:48 2018
New Revision: 341641
URL: https://svnweb.freebsd.org/changeset/base/341641

Log:
  Reduce number of DNS queries in mountd.
  
  As reported by a FreeNAS user (see https://redmine.ixsystems.com/issues/55728),
  mountd does more calls to getnameinfo() than it needs to; this changes it to
  only call it for the RPC calls it needs the name information for.
  
  Reported by:	Dave Flowers
  Reviewed by:	imp, mav
  Approved by:	mav (mentor)
  MFC after:	2 weeks
  Sponsored by:	iXsystems Inc
  Differential Revision:	https://reviews.freebsd.org/D18430

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Thu Dec  6 18:12:50 2018	(r341640)
+++ head/usr.sbin/mountd/mountd.c	Thu Dec  6 18:21:48 2018	(r341641)
@@ -1026,8 +1026,13 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp)
 		syslog(LOG_ERR, "request from unknown address family");
 		return;
 	}
-	lookup_failed = getnameinfo(saddr, saddr->sa_len, host, sizeof host, 
-	    NULL, 0, 0);
+	switch (rqstp->rq_proc) {
+	case MOUNTPROC_MNT:
+	case MOUNTPROC_UMNT:
+	case MOUNTPROC_UMNTALL:
+		lookup_failed = getnameinfo(saddr, saddr->sa_len, host,
+		    sizeof host, NULL, 0, 0);
+	}
 	getnameinfo(saddr, saddr->sa_len, numerichost,
 	    sizeof numerichost, NULL, 0, NI_NUMERICHOST);
 	switch (rqstp->rq_proc) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812061821.wB6ILmIK081493>