Subject: Re: problems with new NFS code
To: Charles M. Hannum <mycroft@NetBSD.ORG>
From: Todd C. Miller <Todd.Miller@cs.colorado.edu>
List: current-users
Date: 02/25/1996 15:21:30
In message <199602250903.EAA18660@pain.lcs.mit.edu>
	so spake "Charles M. Hannum" (mycroft):

>    In a nutshell, using 1024 for
>    rsize and wsize causes NFS-mounts to hang.
> 
> Try also setting a readdirsize of 1k (with `-I=1024'), and see if
> this helps.  I noticed just tonight that this had been separated from
> the read size, and was quite confused by it.

That fixed it.  I see that the man page for mount_nfs states that:

    The value should normally be a multiple of DIRBLKSIZ
    that is <= the read size for the mount.

Perhaps it would make sense to make readdirsize default to
rsize if left unspecified (and rsize is specified)?
It might make sense to also add a readdirsize option to amd
so this can be specified along with rsize and wsize.
I've included two patches that add this.  One just adds
the readdirsize option; the other does the same but also
sets readdirsize to rsize if readdirsize is not defined.
I'm not sure which would be considered more appropriate.
I find the latter more useful in a heterogeneous environment.

 - todd

[ this patch adds a readdirsize option to amd ]

*** nfs_ops.c.DIST	Tue Feb 20 05:46:50 1996
--- /tmp/nfs_ops.c	Sun Feb 25 15:05:32 1996
***************
*** 549,554 ****
--- 549,559 ----
  		strcpy(host + HOSTNAMESZ - 3, "..");
  #endif /* HOSTNAMESZ */
  
+ #ifdef NFSMNT_READDIRSIZE
+ 	if (nfs_args.readdirsize = hasmntval(&mnt, "readdirsize"))
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ #endif
+ 
  	if (nfs_args.rsize = hasmntval(&mnt, "rsize"))
  		nfs_args.flags |= NFSMNT_RSIZE;
  
[ this one does the same but defines readdirsize to be rsize 
  if readdirsize is not defined and rsize is... ]

*** nfs_ops.c.DIST	Tue Feb 20 05:46:50 1996
--- nfs_ops.c	Sun Feb 25 15:16:40 1996
***************
*** 552,557 ****
--- 552,566 ----
  	if (nfs_args.rsize = hasmntval(&mnt, "rsize"))
  		nfs_args.flags |= NFSMNT_RSIZE;
  
+ #ifdef NFSMNT_READDIRSIZE
+ 	if (nfs_args.readdirsize = hasmntval(&mnt, "readdirsize")) {
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ 	} else if (nfs_args.rsize) {
+ 		nfs_args.readdirsize = nfs_args.rsize;
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ 	}
+ #endif
+ 
  	if (nfs_args.wsize = hasmntval(&mnt, "wsize"))
  		nfs_args.flags |= NFSMNT_WSIZE;