Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Apr 2012 15:46:06 -0400
From:      Mark Saad <nonesuch@longcount.org>
To:        freebsd-hackers@freebsd.org
Subject:   mount_nfs does not like exports longer then 88 chars
Message-ID:  <CAMXt9NYvLsMEw_SLC813JfDR%2BzpdcZgtKU9usG0BWOz74hNJ6Q@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.

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


        /*
         * 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 = strlen(spec);
                speclen > 1 && spec[speclen - 1] == '/';
                speclen--)
                spec[speclen - 1] = '\0';
        if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) {
                warnx("%s:%s: %s", hostp, spec, strerror(ENAMETOOLONG));
                return (0);
        }

Does any one know why the check for hostp + spec +1 to be less then
MNAMELEN is there for ?

 I removed the check on my 9-STABLE box and it mounts the long mounts fine

I submitted a pr for this its kern/167105
http://www.freebsd.org/cgi/query-pr.cgi?pr=167105 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMXt9NYvLsMEw_SLC813JfDR%2BzpdcZgtKU9usG0BWOz74hNJ6Q>