kern/167105: mount_nfs can not handle source exports wiht more then 63 chars

Mark Saad msaad at
Thu Apr 19 19:00:24 UTC 2012

>Number:         167105
>Category:       kern
>Synopsis:       mount_nfs can not handle source exports wiht more then 63 chars
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 19 19:00:23 UTC 2012
>Originator:     Mark Saad
>Release:        FreeBSD 9.0-STABLE amd64
System: FreeBSD bguide2 9.0-STABLE FreeBSD 9.0-STABLE #2: Tue Apr 10 11:32:01 EDT 2012 root at amd64

	When using a source nfs export that has more then 63 chars total , in the combination of the source host name + the exported path mount_nfs returns ENAMETOOLONG .

	With the following entry in /etc/fstab 
 fstab entry:  nyisilon2-13.grp2:/ifs/clients/www/csar884520456/files_cms-stage-BK/imagefield_default_images /mnt/csar nfs ro,tcp,intr 0 0

mount /mnt/csar faile with the following error

mount_nfs: nyisilon2-13.grp2:/ifs/clients/www/csar884520456/files_cms-stage-BK/imagefield_default_images: File name too long


In mount_nfs.c removing the conditional check for this on line 734 - 738 appears to remove this limitation
with no impact however am not sure why this check is in there. 

      * if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) {
      *         warnx("%s:%s: %s", hostp, spec, strerror(ENAMETOOLONG));  
      *         return (0);
      * }

Note this issue exists in 7-STABLE , 8-STABLE and 9-STABLE as well as their respective RELEASES


More information about the freebsd-bugs mailing list