Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 1997 18:28:49 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: kern/3304: NFS V2 readdir hangs
Message-ID:  <Pine.BSF.3.95q.970422182240.319B-100000@herring.nlsystems.com>
In-Reply-To: <199704221542.LAA04318@lakes.water.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 22 Apr 1997, Thomas David Rivers wrote:

> > 
> > On Mon, 21 Apr 1997, Thomas David Rivers wrote:
> > 
> > > > I think the most promising candidate is the 'full socket buffers' message.
> > > > Could you see if that goes up consistently when you prompt the system to
> > > > hang.  The match between that and the reassembly number seems to show that
> > > > these are large packets.
> > > 
> > >  We'll do!
> > 
> > I have been looking at the code again today and it seems to me that the
> > client is not reserving enough space in its sockets when it initialises
> > the mount.  Your nasty directory appears to generate a reply packet which
> > is too large for the client to recieve.
> > 
> > I added some code to use a slightly less restrictive buffer size in the
> > NFS client.  I also tidied up the code which sets the size for readdir
> > requests to make it possible to set it to less than 4k and to be more
> > compatible with 2.1.x.  Could you try this patch, both with and without a
> > -r1024 argument to mount_nfs.
> 
> 
>  I tried it out with a -r1024 (and -w1024, which shouldn't matter)
> and without any options except -t60...
> 
>  It worked wonderfully!!!  I'd say commit that patch!!!  (thanks again)
> 
>  Now, I see you set the rcvreserve to "(nm_rsize + NFS_MAXPKTHDR) * 2"
> which, for me was enough - but can we determine just what is 'really'
> enough, or is this just a better guess?  [Is it guaranteed to be
> enough because you bump the readdirsize down to the rsize is rsize 
> is the lesser of the two?]

In the existing code, the main problem I can see is that nm_readdirsize is
allowed to be larger than nm_rsize and indeed is forced to be a minimum of
4k for some spurious reason.  This would mean that if you set nm_rsize to
1024, you would be guaranteed a hang for the first readdir larger than
about 1200 bytes.  Did your hang happen with or without -r1024, or both?

I still don't quite understand the rules used by the socketbuf for these
sizes.  It may be that just forcing nm_readdirsize <= nm_rsize is enough.
I doubled the size to make it the same as the SEQPACKET and STREAM case; I
don't think it will do any harm to leave it doubled.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970422182240.319B-100000>