From owner-freebsd-current@FreeBSD.ORG Tue Feb 21 14:17:30 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 AAEFC16A420 for ; Tue, 21 Feb 2006 14:17:30 +0000 (GMT) (envelope-from vladimir@math.uic.edu) Received: from thor.math.uic.edu (thor.math.uic.edu [131.193.178.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7745843D72 for ; Tue, 21 Feb 2006 14:17:29 +0000 (GMT) (envelope-from vladimir@math.uic.edu) Received: from cvsup.math.uic.edu ([131.193.178.106]:60699 "HELO math.uic.edu") by thor.math.uic.edu with SMTP id S502997AbWBUORQ (ORCPT ); Tue, 21 Feb 2006 08:17:16 -0600 Received: (qmail 10469 invoked by uid 31415); 21 Feb 2006 14:19:32 -0000 Date: Tue, 21 Feb 2006 08:19:32 -0600 From: Vladimir Egorin To: freebsd-current@freebsd.org, matthew.thyer@dsto.defence.gov.au Message-ID: <20060221141932.GA10409@math.uic.edu> References: <20060221015435.GM82482@squash.dsto.defence.gov.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060221015435.GM82482@squash.dsto.defence.gov.au> User-Agent: Mutt/1.5.11 Cc: 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: Tue, 21 Feb 2006 14:17:30 -0000 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. -- Vladimir