Submit #2913
closedsbin/mount_nfs: Add -o retrycnt= from FreeBSD
0%
Description
Matt,
I'd like to bring in a /sbin/mount_nfs option "-o retrycnt=" from FreeBSD.
DragonFly's mount_nfs has -R which is the same as -o retrycount,
but automountd (userspace daemon of autofs port from FreeBSD) needs this.
Using non -o options requires userspace rewrite as the config file parser for automountd assumes mount options are passed via -o.
The parser part of automountd is 100% userspace stuff which means the code is basically 100% compatible with FreeBSD,
so adding this alias to mount_nfs makes more sense than touching the parser only to support non -o format.
https://leaf.dragonflybsd.org/~tkusumi/diff/0001-sbin-mount_nfs-Add-o-retrycnt-from-FreeBSD.patch
Updated by tkusumi over 8 years ago
It's not that automountd requires every single option to have -o alias,
but -o retrycnt is the mandatory one that is hard-coded in exec arguments.
Even if retrycnt option is not used, automountd still tries to mount NFS with retrycnt=1.
Both
fork()/exec("mount_nfs -o retrycnt=1") (default)
or
fork()/exec("mount_nfs -o retrycnt=10")
fails without mount_nfs supporting this format.
https://github.com/freebsd/freebsd/blob/master/usr.sbin/autofs/automountd.c#L331