From owner-freebsd-current@FreeBSD.ORG Thu Feb 23 04:57:24 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 560A216A420 for ; Thu, 23 Feb 2006 04:57:24 +0000 (GMT) (envelope-from wilkinsa@squash.dsto.defence.gov.au) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CD6243D45 for ; Thu, 23 Feb 2006 04:57:18 +0000 (GMT) (envelope-from wilkinsa@squash.dsto.defence.gov.au) Received: from ednmsw501.dsto.defence.gov.au (ednmsw501.dsto.defence.gov.au [131.185.2.150]) by digger1.defence.gov.au with ESMTP id k1N4tKSG016289 for ; Thu, 23 Feb 2006 15:25:20 +1030 (CST) Received: from muttley.dsto.defence.gov.au (unverified) by ednmsw501.dsto.defence.gov.au (Content Technologies SMTPRS 4.3.17) with ESMTP id for ; Thu, 23 Feb 2006 15:27:11 +1030 Received: from fmbex501.dsto.defence.gov.au (fmbex501.dsto.defence.gov.au [146.221.39.230]) by muttley.dsto.defence.gov.au (8.11.3/8.11.3) with ESMTP id k1N4sQp08985 for ; Thu, 23 Feb 2006 15:24:26 +1030 (CST) Received: from squash.dsto.defence.gov.au ([131.185.40.212]) by fmbex501.dsto.defence.gov.au with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id YXL10CSW; Thu, 23 Feb 2006 15:54:19 +1100 Received: from squash.dsto.defence.gov.au (localhost [127.0.0.1]) by squash.dsto.defence.gov.au (8.13.3/8.13.3) with ESMTP id k1N4tIZU094629 for ; Thu, 23 Feb 2006 15:25:18 +1030 (CST) (envelope-from wilkinsa@squash.dsto.defence.gov.au) Received: (from wilkinsa@localhost) by squash.dsto.defence.gov.au (8.13.3/8.13.3/Submit) id k1N4tIle094628 for freebsd-current@freebsd.org; Thu, 23 Feb 2006 15:25:18 +1030 (CST) (envelope-from wilkinsa) Date: Thu, 23 Feb 2006 15:25:17 +1030 From: "Wilkinson, Alex" To: freebsd-current@freebsd.org Message-ID: <20060223045515.GW92877@squash.dsto.defence.gov.au> Mail-Followup-To: freebsd-current@freebsd.org References: <20060221015435.GM82482@squash.dsto.defence.gov.au> <20060221141932.GA10409@math.uic.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20060221141932.GA10409@math.uic.edu> User-Agent: Mutt/1.5.11 Subject: Re: netgroup limits on -current ... [mountd(8)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2006 04:57:24 -0000 0n Tue, Feb 21, 2006 at 08:19:32AM -0600, Vladimir Egorin wrote: >On Tue, Feb 21, 2006 at 12:24:35PM +1030, Wilkinson, Alex wrote: > > OS: FreeBSD 7.0-CURRENT #24: Thu Feb 16 12:28:58 CST 2006 > > > > Hi all, > > > > We are currently experiencing problems with FreeBSD -CURRENT and mountd(8). > > When we export a filesystem via NFS to a netgroup with a 'large' number of hosts > > in it we get all sorts of truncation. There looks like a limit on the number of > > hosts in a netgroup FreeBSD's mountd(8) can export to. e.g. > > > > NFS Export > > ---------- > > > > /export/home/username my_netgroup > > > > mountd(8) In Debugging Mode > > --------------------------- > > > > Feb 21 12:10:49 host mountd[83451]: can't get address info for host hostname.dsto.defence.g > > Feb 21 12:10:49 host mountd[83451]: bad host host.dsto.defence.g in netgroup my_netgroup, skipping > > > > This happens as mountd(8) builds its exports list via: > > > > mountd: getting export list > > mountd: got line /export/home/username my_netgroup > > mountd: making new ep fs=0x4297314f,0x57f85ac > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > got host host.dsto.defence.gov.au > > > > ... > > > > relevant code producing this error: > > > > /usr/src/usr.sbin/mountd > > > > get_host(cp, grp, tgrp) > > char *cp; > > struct grouplist *grp; > > struct grouplist *tgrp; > > { > > struct grouplist *checkgrp; > > struct addrinfo *ai, *tai, hints; > > int ecode; > > char host[NI_MAXHOST]; > > > > if (grp->gr_type != GT_NULL) { > > syslog(LOG_ERR, "Bad netgroup type for ip host %s", cp); > > return (1); > > } > > memset(&hints, 0, sizeof hints); > > hints.ai_flags = AI_CANONNAME; > > hints.ai_protocol = IPPROTO_UDP; > > ecode = getaddrinfo(cp, NULL, &hints, &ai); > > if (ecode != 0) { > > syslog(LOG_ERR,"can't get address info for host %s", cp); > > return 1; > > } > > grp->gr_ptr.gt_addrinfo = ai; > > while (ai != NULL) { > > if (ai->ai_canonname == NULL) { > > if (getnameinfo(ai->ai_addr, ai->ai_addrlen, host, > > sizeof host, NULL, 0, NI_NUMERICHOST) != 0) > > strlcpy(host, "?", sizeof(host)); > > ai->ai_canonname = strdup(host); > > ai->ai_flags |= AI_CANONNAME; > > } > > if (debug) > > fprintf(stderr, "got host %s\n", ai->ai_canonname); > > /* > > * Sanity check: make sure we don't already have an entry > > * for this host in the grouplist. > > */ > > for (checkgrp = tgrp; checkgrp != NULL; > > checkgrp = checkgrp->gr_next) { > > if (checkgrp->gr_type != GT_HOST) > > continue; > > for (tai = checkgrp->gr_ptr.gt_addrinfo; tai != NULL; > > tai = tai->ai_next) { > > if (sacmp(tai->ai_addr, ai->ai_addr, NULL) != 0) > > continue; > > if (debug) > > fprintf(stderr, > > "ignoring duplicate host %s\n", > > ai->ai_canonname); > > grp->gr_type = GT_IGNORE; > > return (0); > > } > > } > > ai = ai->ai_next; > > } > > > > > > Can someone please tell me if there is a limit on the number characters or hosts > > that mountd(8) can build an export list from ? And if so can we increase it ? > > > > Cheers > > > > - aW > >This reminds me of an old problem I had on a solaris 2.5.1 -- it was not possible >to have a "large" number of hosts in the netgroup and (thus) in the export list. >The solution was to split the large netgroup into a number of smaller netgroups, >and then combine them into a large netgroup using the smaller netgroups' names. >We did that with a C program, you could also do that in a script. > >The problem was a limit of 255 characters on the length of the >netgroup list. > >I still have the program if you are interested. Thats exactly the type of hack we are wanting to avoid. Thanks anyway. -aW