From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 20 00:58:50 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DB0D106566C for ; Fri, 20 Apr 2012 00:58:50 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id BA4FE8FC16 for ; Fri, 20 Apr 2012 00:58:49 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAJKzkE+DaFvO/2dsb2JhbABAA4VnrHCCCQEBAQQBAQEgKyAGBQwNAg4DBAEBAQICDRYDAikBCRUJCAYIBwQBCBQEh24Lp2GTAIEviUKCTIISgRgEk0WCLIERiEaGZYMDgUA X-IronPort-AV: E=Sophos;i="4.75,450,1330923600"; d="scan'208";a="165827263" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 19 Apr 2012 20:58:49 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 18620B4039; Thu, 19 Apr 2012 20:58:49 -0400 (EDT) Date: Thu, 19 Apr 2012 20:58:49 -0400 (EDT) From: Rick Macklem To: Mark Saad Message-ID: <182169197.3115940.1334883529079.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: freebsd-hackers@freebsd.org Subject: Re: mount_nfs does not like exports longer then 88 chars X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 00:58:50 -0000 Mark Saad wrote: > On Thu, Apr 19, 2012 at 3:51 PM, Andrew Duane > wrote: > > MNAMELEN is used to bound the Mount NAMe LENgth, and is used in many > > many places. It may seem to work fine, but there are lots of > > utilities and such that will almost certainly fail managing it. > > Search the source code for MNAMELEN..... >=20 > I see that this is used in a number of Mount and fs bits. Do you know > why mount_nfs would care how long the exported path and hostname are ? >=20 Well, it's copied to f_mntfromname in "struct statfs". If one longer than MNAMELEN is allowed, it gets truncated when copied. I have no idea which userland apps. will get upset with a truncated value in f_mntfromname. (To change the size of f_mntfromname would require a new revision of the statfs syscall, I think?) Does this answer what you were asking? rick > > > > =C2=A0................................... > > Andrew Duane > > Juniper Networks > > +1 978-589-0551 (o) > > +1 603-770-7088 (m) > > aduane@juniper.net > > > > > > > > > >> -----Original Message----- > >> From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > >> hackers@freebsd.org] On Behalf Of Mark Saad > >> Sent: Thursday, April 19, 2012 3:46 PM > >> To: freebsd-hackers@freebsd.org > >> Subject: mount_nfs does not like exports longer then 88 chars > >> > >> Hello Hackers > >> =C2=A0 I was wondering if anyone has come across this issue. This exis= ts > >> =C2=A0 in > >> FreeBSD 6, 7, and 9 , and probably in 8 but I am not using it at > >> this time. > >> When a nfs export path and host name total to more then 88 > >> characters > >> mount_nfs bombs out with the following error when it attempts to > >> mount it. > >> > >> mount_nfs: > >> nyisilon2-13.grp2:/ifs/clients/www/csar884520456/files_cms- > >> stage-BK/imagefield_default_images: > >> File name too long > >> > >> I traced this down to a check in mount_nfs.c . This is about line > >> 560 > >> in the 7-STABLE version and 734 in the 9-STABLE version > >> > >> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* If there has been a trailing slash= at mounttime it seems > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* that some mountd implementations f= ail to remove the > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mount > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* entries from their mountlist while= unmounting. > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (speclen =3D strlen(spec); > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 speclen > 1 &&= spec[speclen - 1] =3D=3D '/'; > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 speclen--) > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 spec[speclen -= 1] =3D '\0'; > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (strlen(hostp) + strlen(spec) + 1 > MNA= MELEN) { > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 warnx("%s:%s: = %s", hostp, spec, > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 strerror(ENAME= TOOLONG)); > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0); > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > >> > >> Does any one know why the check for hostp + spec +1 to be less then > >> MNAMELEN is there for ? > >> > >> =C2=A0I removed the check on my 9-STABLE box and it mounts the long > >> =C2=A0mounts fine > >> > >> I submitted a pr for this its kern/167105 > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D167105 as there is no > >> mention of this in the man page and I cant find any reason for the > >> check at all. > >> > >> > >> -- > >> mark saad | nonesuch@longcount.org > >> _______________________________________________ > >> freebsd-hackers@freebsd.org mailing list > >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > >> To unsubscribe, send any mail to "freebsd-hackers- > >> unsubscribe@freebsd.org" >=20 >=20 >=20 > -- > mark saad | nonesuch@longcount.org > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org"