Subject: General amd issues (Re: I have it working now)
To: None <davem@nadzieja.rutgers.edu>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: current-users
Date: 11/24/1994 14:56:50
[Discussion from port-sparc about using a reserved port for "amd" mounts]

> I added or's to the appropriate nfs_args settings in nfs_ops.c in "amd" and
> now "amd" works like a charm.  Although this is a complete hack, it works for
> me.  Thanks to all who tried to give me a hand in this matter.
>
> The flags I have set to get this working are:
>
> 	NFSMNT_NOCONN

"amd" already has some code to check for a "noconn" option (and "spongy" and
"wsize" and so on and so on ... ); perhaps this could be put into the "amd" map
entries?

> and
>
> 	NFSMNT_RESVPORT

Given that "amd" supports "noconn", I would normally propose that this use of
NFSMNT_RESVPORT be supported by an additional option like "resvport" (in
/usr/src/usr.sbin/amd/amd/nfs_ops.c::mount_nfs_fh() ), which adds something
along the lines of:

...
#ifdef MNTOPT_NOCONN
        if (hasmntopt(&mnt, "noconn") != NULL)
                nfs_args.flags |= NFSMNT_NOCONN;
#endif /* MNTOPT_NOCONN */

/* Add this */

#ifdef MNTOPT_RESVPORT
        if (hasmntopt(&mnt, "resvport") != NULL)
                nfs_args.flags |= NFSMNT_RESVPORT;
#endif /* MNTOPT_NOCONN */
...

Anyone agree?  However, "amd" isn't "our code", so to speak.  What to do?

On the other hand, it points out some apparent "amd" buglets:

...
#ifdef NFSMNT_SPONGY
        if (hasmntopt(&mnt, "spongy") != NULL) {
                nfs_args.flags |= NFSMNT_SPONGY;
...
        }
#endif /* MNTOPT_SPONGY */

Is that "#ifdef" supposed to be "NFSMNT_SPONGY", or "MNTOPT_SPONGY"?

Also, should the "#ifdef MNTOPT_NOCONN" really be "#ifdef NFSMNT_NOCONN", since
e.g. NetBSD has "NFSMNT_NOCONN"?

The whole issue of using "MNTOPT_<something>" vs. "NFSMNT_<something>" seems
somewhat hazy to me ... especially because amd's config/os-bsd44.h only defines
"MNTOPT_SOFT" and "MNTOPT_HARD".  Does a system have to have a generic "foo"
mount option for "MNTOPT_FOO" to be used instead of directly checking for
NFSMNT_FOO?

Also, the AMD Reference Manual claims that

	For example, only 4.4 BSD is known to implement the ``compress'' and
	``spongy'' options.

but our <sys/mount.h> doesn't know anything about either NFSMNT_SPONGY or
NFSMNT_COMPRESS ...

Executive Summary: What's the Real Fix to all of this?  (Given that NetBSD
supports NFSMNT_NOCONN and NFSMNT_RESVPORT and all ... )

A few other minor "amd" observations:

(a) The code in nfs_ops.c:mount_nfs_fh() that sets the flags looks nearly 100%
    identical to the code in the SunOS automounter (auto_mount.c:nfsmount() ).
    I hope that Jan-Simon Pendry and Brent Callaghan had some sort of agreement
    going, otherwise Sun's lawyers would have a field day with this ... (-:

(b) Looking at NetBSD's <sys/mount.h>, it looks like the support for being able
    to set the min/max hold times for the {file,dir} attribute caches isn't
    there.  I wonder why, because tuning "actimeo", "acregmax" & friends was a
    useful feature for doing NFS over slow-speed (read: SLIP or PPP) links.
    (Does the 4.4 NFS even have an attribute cache?  I see "amd" has "nocache"
     in its list of default mount flags ... )

Sorry for the long-windedness,

	- Greg