NFS-mounting directories with colons is tricky and undocumented
Gergely Czuczy
gergely.czuczy at harmless.hu
Thu Aug 17 17:49:03 UTC 2017
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
More information about the freebsd-fs
mailing list