From owner-freebsd-hackers Mon Aug 2 16:19:34 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id 9289214C22 for ; Mon, 2 Aug 1999 16:19:32 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id QAA16171; Mon, 2 Aug 1999 16:18:48 -0700 (PDT) (envelope-from dillon) Date: Mon, 2 Aug 1999 16:18:48 -0700 (PDT) From: Matthew Dillon Message-Id: <199908022318.QAA16171@apollo.backplane.com> To: Dag-Erling Smorgrav , Alfred Perlstein , Doug , freebsd-hackers@FreeBSD.ORG Subject: Re: readdirplus is very cool, any other nfs client suggestions? References: <199908021455.HAA13149@apollo.backplane.com> <199908021543.IAA13578@apollo.backplane.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : Now on to the NFSv2 fhlen patch testing. I haven't run v2 in several : months, hopefully it still works :-) My buildworld using the NFSv2 file handle length patch succeeded as well. I've included the patch again for reference. (Note: I didn't write this patch, refer back to the thread for that info). -Matt Index: nfsm_subs.h =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfsm_subs.h,v retrieving revision 1.24 diff -u -r1.24 nfsm_subs.h --- nfsm_subs.h 1999/06/23 04:44:14 1.24 +++ nfsm_subs.h 1999/08/02 17:22:38 @@ -419,24 +419,25 @@ } } #define nfsm_srvmtofh(f) \ - { int fhlen = NFSX_V3FH; \ + do { \ + int fhlen; \ if (nfsd->nd_flag & ND_NFSV3) { \ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \ fhlen = fxdr_unsigned(int, *tl); \ - if (fhlen == 0) { \ - bzero((caddr_t)(f), NFSX_V3FH); \ - } else if (fhlen != NFSX_V3FH) { \ + if (fhlen != 0 && fhlen != NFSX_V3FH) { \ error = EBADRPC; \ nfsm_reply(0); \ } \ + } else { \ + fhlen = NFSX_V2FH; \ } \ if (fhlen != 0) { \ - nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \ - bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \ - if ((nfsd->nd_flag & ND_NFSV3) == 0) \ - nfsm_adv(NFSX_V2FH - NFSX_V3FH); \ + nfsm_dissect(tl, u_int32_t *, fhlen); \ + bcopy((caddr_t)tl, (caddr_t)(f), fhlen); \ + } else { \ + bzero((caddr_t)(f), NFSX_V3FH); /* XXX why not do a EBADRPC? */ \ } \ - } + } while (0) #define nfsm_clget \ if (bp >= be) { \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message