cvs commit: src/sys/nfsclient nfs_vfsops.c

Bruce Evans brde at optusnet.com.au
Wed Oct 31 08:23:35 PDT 2007


On Sat, 27 Oct 2007, Craig Rodrigues wrote:

> rodrigc     2007-10-27 16:28:05 UTC
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/nfsclient        nfs_vfsops.c
>  Log:
>  Add the following mount options to the nfs_opts array:
>  noatime, noexec, suiddir, nosuid, nosymfollow, union,
>  noclusterr, noclusterw, multilabel, acls, force, update,
>  async.  These options correspond to MOPT_STDOPTS, MOPT_FORCE, MOPT_UPDATE,
>  and MOPT_ASYNC.
>
>  Currently, mount_nfs converts these "-o" options from strings
>  to MNT_ flags via getmntopts(),
>  and passes the flags from userspace to the kernel.
>  This change will allow us in future to pass these mount options
>  as strings directly to the kernel via nmount() when doing NFS mounts.

Most of these options don't belong here, since nfs doesn't support most
of these options.  Even fewer of them ever belonged in MOPT_STDOPTS,
since some file systems are even less standard than nfs.  A copuple of
them are actually global, so they actually belong in MOPT_STDOPTS; then
they belong in nmount's global options, not here.

[I refer to the positive options since having to put the "no" options in
options list is bogus]:
- atime: client doesn't even support normal setting of atimes (atimes mostly
     get set accidentally and incorrectly as a side affect of reads
     on the server (if the server supports atimes)).  Most reads
     are from the cache, as is needed for speed, so most reads
     don't change the atime, also as needed for speed.  nfs does
     even less to support not setting atimes -- it has no references
     to MNT_NOATIME, and there is no protocol to push MNT_NOATIME
     to the server.
- exec: probably correct, but currently has no effect since noexec is in
     nmount's global options list.  It probably shouldn't be in the
     global options list, but that is another bug.  It can't quite be
     a global option since not all file systems support exec; noexec to
     disable exec for these file systems is harmless nonsense.
- suiddir: this is ffs-only, so it having it in MOPT_STDOPTs was a much
     larger bug than having MOPT_ATIME there.
- suid: like exec, except it is our of order in this list.
- symfollow: correct, since it is a non-global like exec.  This option is
     implemented entirely at the vfs level, but it is nonsense if the
     file system doesn't support symlinks.  It is nonsense even here if the
     server's file system doesn't support symlinks.  We might want to allow
     harmless nonsense like this at the global level to avoid having to
     duplicate options in per-fs list.  It would clearly be overkill to
     require nfs clients disallow harmless options because the server doesn't
     support them.
- union: this one is probably truly global.
- clusterr, clusterw: not supported by nfs clients.  Clustering (or not)
     for nfs is mainly decided by servers.  Out of order in this list.
- multilabel, acls: like suidir (ffs-only) (?).  Out of order in this list.
- force: not quite a global.  All fs's should support this, perhaps as
     a no-op.  Out of order in this list.
- update: not quite a global, and already in nmount's global list.
- async: correct.  Out of order in this list.  Hmm, I need this option, and
   haven't missed it since I use old mount utilities with current kernels.
   The old utilities support it via it being bogusly in MNT_STDOPTS.

Bruce


More information about the cvs-all mailing list