Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2017 19:43:16 +0200
From:      Gergely Czuczy <gergely.czuczy@harmless.hu>
To:        ume@freebsd.org, freebsd-fs@freebsd.org
Subject:   NFS-mounting directories with colons is tricky and undocumented
Message-ID:  <a831ecaf-b301-5d91-3473-d52a3cf38a68@harmless.hu>

next in thread | raw e-mail | index | archive | help
Hello,

The other day I had a failure mounting a package directory to its build VM:

mount_nfs: 10.219.14.254:/tank/packages/FreeBSD:12: hostname nor 
servname provided, or not known

Genesys on efnet pointed me to r203490, which said:

Introduce '[ipaddr]:path' notation.

Since the existing implementation searches ':' backward, a path which
includes ':' could not be mounted.  You can now mount such path by
enclosing an IP address by '[]'.
Though we should change to search ':' forward, it will break
'ipv6addr:path' which is currently working.  So, it still searches ':'
backward, at least for now.

Which provides way of doing it, however, I think a couple of 
improvements could be done:

 1. Documentation is missing from mount_nfs(8)
 2. Maybe it would worth improving the algorithm to something more
    effect, resulting in the expected behaviour:
      * A) Do a colon-forward search, skipping the part in []. With
        ipv6, that means the colons in the addresses are skipped due to
        the [] notation, then the first colon breaks the token, and
        starts the path
      * B) Stop looking for colons at the first slash. Hostnames and IP
        addresses are not allowed to contain slashes, and AFAIK the code
        doesn't have to deal with CIDR ranges.

If possible, I would like task, whether the parsing code here could be 
improved to be more human-friendly, and work as it expected to? AFAIK 
ipv6 addresses are usually enclosed within [], while ipv4 addresses are 
not, and people are expecting such behavior from codes as well. And 
please, whatever happens to the parsing code, update the documentation. 
FreeBSD has a reputation for its good quality docs, and this corner case 
is totally not covered.

Best regards,
Gergely





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a831ecaf-b301-5d91-3473-d52a3cf38a68>