From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 20 03:27:28 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 2779B106566B for ; Fri, 20 Apr 2012 03:27:28 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id C99568FC14 for ; Fri, 20 Apr 2012 03:27:27 +0000 (UTC) Received: by vcmm1 with SMTP id m1so8480901vcm.13 for ; Thu, 19 Apr 2012 20:27:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to :x-gm-message-state; bh=VS4KND60rDd/SP7O8wJy8KftudHbZtwPCwV/jHw1G9c=; b=NWCYJAHhLCeqcZyrn9+g5FLd0EepOn9YHmERb/ZQScVV563Qbl71CXhVZmmiF66UM/ ppexQsO+y4jVaOENKF7vqFjF8EvnlWxe76UZLII6IkdRSOKUfV4BUt+NROa+dlBQt+xt Vt6fwH8jx5eU02XDIqRnJfd9lXPGtSGCYVUXtjd95v7+rEgvhSwpURdxaEq5yKtvS5dP L7nrJMdQD8oJyB3WuAuBhu5EfSLcAwzoYeMlp1MnIxQmbkGFxmQifFVTYXQdQbaPEOhi Q2h2WaKdtY22J4lTlfWCrZpWdhK2Q2GAgJpOWfwu+3LlZ0kpb8MpPn1n7Xm8/zZh2UxW 7kMA== Received: by 10.220.153.8 with SMTP id i8mr2925834vcw.73.1334892446788; Thu, 19 Apr 2012 20:27:26 -0700 (PDT) Received: from [192.168.11.202] (ool-182c8651.dyn.optonline.net. [24.44.134.81]) by mx.google.com with ESMTPS id d7sm5314978vdu.15.2012.04.19.20.27.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 20:27:25 -0700 (PDT) References: <182169197.3115940.1334883529079.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <182169197.3115940.1334883529079.JavaMail.root@erie.cs.uoguelph.ca> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9B179) From: Mark Saad Date: Thu, 19 Apr 2012 23:27:22 -0400 To: Rick Macklem X-Gm-Message-State: ALoCoQk6KA7lwbguExIPILFyq6fEPhGfiPpd0/j+bXD8lw+wxjUEKzEGRWbbRgNSKSH8iPwBISJ8 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 03:27:28 -0000 On Apr 19, 2012, at 8:58 PM, Rick Macklem wrote: > 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?) >=20 > Does this answer what you were asking? rick >=20 Yes and no, it smells like a bug ,in so far as its not mentioned anywhere ou= t there . A one line addition to mount_nfs man page stipulating that there i= s a known limit on the length of the host name and source export would be he= lpful. =20 On the other hand 88 bytes seams like an odd size to me . The check for the= size happens twice in the 7-stable code ,for mount_nfs, and only once in th= e 9-stable code . Not sure why either, and i did bot research it yet. In th= e mean time I am going to take a peak at the other bsd's and see if there is= a solution .=20 >>>=20 >>> ................................... >>> Andrew Duane >>> Juniper Networks >>> +1 978-589-0551 (o) >>> +1 603-770-7088 (m) >>> aduane@juniper.net >>>=20 >>>=20 >>>=20 >>>=20 >>>> -----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 >>>>=20 >>>> Hello Hackers >>>> I was wondering if anyone has come across this issue. This exists >>>> 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. >>>>=20 >>>> mount_nfs: >>>> nyisilon2-13.grp2:/ifs/clients/www/csar884520456/files_cms- >>>> stage-BK/imagefield_default_images: >>>> File name too long >>>>=20 >>>> 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 >>>>=20 >>>>=20 >>>> /* >>>> * If there has been a trailing slash at mounttime it seems >>>> * that some mountd implementations fail to remove the >>>> mount >>>> * entries from their mountlist while unmounting. >>>> */ >>>> for (speclen =3D strlen(spec); >>>> speclen > 1 && spec[speclen - 1] =3D=3D '/'; >>>> speclen--) >>>> spec[speclen - 1] =3D '\0'; >>>> if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { >>>> warnx("%s:%s: %s", hostp, spec, >>>> strerror(ENAMETOOLONG)); >>>> return (0); >>>> } >>>>=20 >>>> Does any one know why the check for hostp + spec +1 to be less then >>>> MNAMELEN is there for ? >>>>=20 >>>> I removed the check on my 9-STABLE box and it mounts the long >>>> mounts fine >>>>=20 >>>> 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. >>>>=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" >>=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"