Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 1999 14:37:19 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bill Paul <wpaul@skynet.ctr.columbia.edu>
Cc:        peter@netplex.com.au, crossd@cs.rpi.edu, current@FreeBSD.ORG
Subject:   Re: IRIX 6.5.4 NFS v3 TCP client + FreeBSD server = bewm
Message-ID:  <199907292137.OAA78832@apollo.backplane.com>
References:   <199907292044.QAA17186@skynet.ctr.columbia.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
:                        /*
:                         * If either the dircount or maxcount will be
:                         * exceeded, get out now. Both of these lengths
:                         * are calculated conservatively, including all
:                         * XDR overheads.
:                         */
:                        len += (7 * NFSX_UNSIGNED + nlen + rem + NFSX_V3FH +
:                                NFSX_V3POSTOPATTR);
:                        dirlen += (6 * NFSX_UNSIGNED + nlen + rem);
:                        if (len > cnt || dirlen > fullsiz) {
:                                eofflag = 0;
:                                break;
:                        }
:
:Unfortunately I haven't been able to wrap my brain around how this is
:being counted up for the "len" calculation. Whatever it's doing, it's
:off by 4 bytes. Possibly somebody forgot that "filename3" is a string,
:which in XDR format consists of a string bytes, plus padding to a longword
:boundary, *plus* a longword length value. Some comments would have been
:useful here. (Hint, hint.)
:
:What I don't know is whether or not the calculation for dirlen is
:wrong or not. Hopefully now that I've shown everyone the light, maybe
:somebody can tell me for sure.
:
:-Bill

    I think dirlen is supposed to be a calculation of the size of the 
    struct dirent that the client will eventually synthesize from all
    of this, in order to ensure that the result synthesized by the client
    does not cross a 512 byte boundry.  But if it is, it is being *very*
    conservative.

    I think this may simply be because different clients have different
    structural sizes for struct dirent.  I am guess that the 
    (6 * NFSX_UNSIGNED) is basically a NFS constant.
    
					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907292137.OAA78832>