Hi Kurt,

Kurt Mosiejczuk wrote on Mon, Mar 11, 2019 at 09:32:41AM -0400:

> As far as I can tell, no man page documents the fs_mntops form of the
> mount_nfs(8) options for fstab(5). Most of us who use them either know
> from some other documentation, reading the source, or just doing a
> copy-paste from somwhere.
> 
> I went through the source and wrote them down, and here is a first stab
> at documenting them in mount_nfs(8).

I like the general idea, but have lots of comments regarding specific
details.

> I can't really think of a better place to put this information than
> mount_nfs(8), but welcome suggestions. I also welcome feedback on how
> best to push this information into the man page.

I can't think of a better place than mount_nfs(8) either.

One aspect that i overlooked when we initially discussed this
(because i didn't actually read the code back then, i only looked
at it right now checking the details): the fstab(5) options can
also be given via -o and vice versa, and that ought to be documented.
Equivalence is guaranteed because mount(8) actually forks and execs
mount_nfs(8), passing the data taken from fstab(5) via argv[].

So i suggest the following style:

  .It Fl 2 No or Fl o Cm nfsv2
  Use the NFS Version 2 protocol.

Regarding the command line options taking arguments (-agIRrtwx):
It appears these can be specified as

  mount -o -t=...

on the command line or as

  ... nfs ro,-t=...

in fstab(5).  According to my testing (and my reading of the code),
the forms

  mount -o timeo=...
  ... nfs ro,timeo=...

that you are documenting do *not* work.  I suspect you confused the
field names in the struct nfs_args in the source code with the
option names to be used in -o/fstab(5).

So, we have four classes of options:

 * no arguments, equivalent -o/fstab(5) option exists
    -2  =  -o nfsv2       /* wrong name in your diff? */
    -3  =  -o nfsv3       /* wrong name in your diff? */
    -b  =  -o bg
    -c  =  -o noconn
    -d  =  -o dumbtimer   /* missing in your diff */
    -i  =  -o intr
    -l  =  -o rdirplus    /* wrong name in your diff? */
    -s  =  -o soft
    -T  =  -o tcp
    -U  =  -o mntudp      /* wrong name in your diff? */

 * no arguments, can be specified with -o/fstab(5) only:

           -o resvport    /* missing in your diff */
           -o noac

 * takes an argument, no explicit -o equivalent
    -a arg  =  -o -a=arg  /* wrong name in your diff */
    -g arg  =  -o -g=arg  /* wrong name in your diff */
    -I arg  =  -o -I=arg  /* wrong name in your diff */
    -R arg  =  -o -R=arg  /* wrong name in your diff */
    -r arg  =  -o -r=arg  /* wrong name in your diff */
    -t arg  =  -o -t=arg  /* wrong name in your diff */
    -w arg  =  -o -w=arg  /* wrong name in your diff */
    -x arg  =  -o -x=arg  /* wrong name in your diff */

 * takes an argument, can be specified with -o/fstab(5) only:

               -o port=arg
               -o acdirmax=arg
               -o acdirmin=arg
               -o acregmax=arg
               -o acregmin=arg

Below -o, it should probably be said that all other options described
in mount_nfs(8)

 1. can be passed to mount(8) like "mount -o -b,-t=timeout"
    or like "mount -o bg,-t=timeout"

 2. and can be specified in fstab(5) like
    ... /mountpoint nfs options,-b,-t=timeout ...
    or like
    ... /mountpoint nfs options,bg,-t=timeout ...

This is not intended as a suggestion for the wording, but only
as an indication of the content that probably needs to be conveyed.

> Index: mount_nfs.8
> ===================================================================
> RCS file: /cvs/src/sbin/mount_nfs/mount_nfs.8,v
> retrieving revision 1.39
> diff -u -p -r1.39 mount_nfs.8
> --- mount_nfs.8       6 Jun 2009 20:58:50 -0000       1.39
> +++ mount_nfs.8       10 Mar 2019 19:28:01 -0000
> @@ -66,27 +66,48 @@ It implements the mount protocol as desc
>  .%T "NFS: Network File System Version 3 Protocol Specification" ,
>  Appendix I.
>  .Pp
> -The options are as follows:
> +The options are as follows.
> +Many of them can be specified permanently in the
> +.Fa fs_mntopts
> +field of the 
> +.Xr fstab 5
> +configuration file for use with the one-argument form of
> +.Xr mount 8 .

Even though i suggested this wording, this change should probably
be reverted, given the above analysis.

I think you need to rework you diff.

Yours,
  Ingo

Reply via email to